Subversion Repositories Kolibri OS

Rev

Rev 7515 | Rev 7985 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7515 Rev 7774
1
#define MEMSIZE 0xA0000
1
#define MEMSIZE 0xA0000
2
#include "..\lib\kolibri.h" 
2
#include "..\lib\kolibri.h" 
3
#include "..\lib\mem.h" 
3
#include "..\lib\mem.h" 
4
#include "..\lib\strings.h"
4
#include "..\lib\strings.h"
5
#include "..\lib\fs.h"
5
#include "..\lib\fs.h"
6
 
6
 
7
#ifndef AUTOBUILD
7
#ifndef AUTOBUILD
8
#include "lang.h--"
8
#include "lang.h--"
9
#endif
9
#endif
10
 
10
 
11
/////////////////////////////////////////////////////////////////////////////////////////
11
/////////////////////////////////////////////////////////////////////////////////////////
12
/////////////////////////              Program data                  ////////////////////
12
/////////////////////////              Program data                  ////////////////////
13
/////////////////////////////////////////////////////////////////////////////////////////
13
/////////////////////////////////////////////////////////////////////////////////////////
14
 
14
 
15
struct ioctl_struct
15
struct ioctl_struct
16
{
16
{
17
	dword	handle;
17
	dword	handle;
18
	dword	io_code;
18
	dword	io_code;
19
	dword	input;
19
	dword	input;
20
	dword	inp_size;
20
	dword	inp_size;
21
	dword	output;
21
	dword	output;
22
	dword	out_size;
22
	dword	out_size;
23
};
23
};
24
 
24
 
25
#define DEV_ADD_DISK 1	//input = structure add_disk_struc
25
#define DEV_ADD_DISK 1	//input = structure add_disk_struc
26
#define DEV_DEL_DISK 2	//input = structure del_disk_struc
26
#define DEV_DEL_DISK 2	//input = structure del_disk_struc
27
 
27
 
28
struct add_disk_struc
28
struct add_disk_struc
29
{
29
{
30
	dword DiskSize; // in sectors, 1 sector = 512 bytes. Include FAT service data
30
	dword DiskSize; // in sectors, 1 sector = 512 bytes. Include FAT service data
31
	unsigned char DiskId; // from 0 to 9
31
	unsigned char DiskId; // from 0 to 9
32
};
32
};
33
 
33
 
34
struct del_disk_struc
34
struct del_disk_struc
35
{
35
{
36
	unsigned char DiskId; //from 0 to 9
36
	unsigned char DiskId; //from 0 to 9
37
};
37
};
38
 
38
 
39
 
39
 
40
ioctl_struct ioctl;
40
ioctl_struct ioctl;
41
add_disk_struc add_disk;
41
add_disk_struc add_disk;
42
del_disk_struc del_disk;
42
del_disk_struc del_disk;
43
 
43
 
44
int driver_handle;
44
int driver_handle;
45
 
45
 
46
/////////////////////////////////////////////////////////////////////////////////////////
46
/////////////////////////////////////////////////////////////////////////////////////////
47
/////////////////////////                    Code                    ////////////////////
47
/////////////////////////                    Code                    ////////////////////
48
/////////////////////////////////////////////////////////////////////////////////////////
48
/////////////////////////////////////////////////////////////////////////////////////////
49
#include "t_console.c"
49
#include "t_console.c"
50
#include "t_gui.c"
50
#include "t_gui.c"
51
 
51
 
52
 
52
 
53
void main()
53
void main()
54
{   
54
{   
55
	driver_handle = LoadDriver("tmpdisk");
55
	driver_handle = LoadDriver("tmpdisk");
56
	if (driver_handle==0)
56
	if (driver_handle==0)
57
	{
57
	{
58
		notify("'TmpDisk\nError: /rd1/1/drivers/tmpdisk.obj driver loading failed\nvirtual disk wouldn't be added' -tE");
58
		notify("'TmpDisk\nError: /rd/1/drivers/tmpdisk.obj driver loading failed\nVirtual disk wouldn't be added' -tE");
59
		ExitProcess();
59
		ExitProcess();
60
	}
60
	}
61
 
61
 
62
	if (param)
62
	if (param)
63
		Console_Work();
63
		Console_Work();
64
	else
64
	else
65
		Main_Window();
65
		Main_Window();
66
		
66
		
67
	ExitProcess();
67
	ExitProcess();
68
}
68
}
69
 
69
 
70
stop:
70
stop: