Subversion Repositories Kolibri OS

Rev

Rev 7985 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

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