Added a check to the FDD driver to disable it at runtime
authorJohn Hodge <[email protected]>
Sun, 4 Jul 2010 03:24:15 +0000 (11:24 +0800)
committerJohn Hodge <[email protected]>
Sun, 4 Jul 2010 03:24:15 +0000 (11:24 +0800)
Modules/Storage/FDD/fdd.c

index 23fd4db..4a6a5b4 100644 (file)
@@ -2,7 +2,7 @@
  * AcessOS 0.1
  * Floppy Disk Access Code
  */
-#define DEBUG  0
+#define DEBUG  1
 #include <acess.h>
 #include <modules.h>
 #include <fs_devfs.h>
@@ -136,6 +136,7 @@ tDevFS_Driver       gFDD_DriverInfo = {
 int FDD_Install(char **Arguments)
 {
        Uint8 data;
+       char    **args = Arguments;
        
        // Determine Floppy Types (From CMOS)
        outb(0x70, 0x10);
@@ -145,6 +146,14 @@ int FDD_Install(char **Arguments)
        gFDD_Devices[0].track[0] = -1;
        gFDD_Devices[1].track[1] = -1;
        
+       if(args) {
+               for(;*args;args++)
+               {
+                       if(strcmp(*args, "disable")==0)
+                               return MODULE_ERR_NOTNEEDED;
+               }
+       }
+       
        Log_Log("FDD", "Detected Disk 0: %s and Disk 1: %s", cFDD_TYPES[data>>4], cFDD_TYPES[data&0xF]);
        
        if( data == 0 ) {

UCC git Repository :: git.ucc.asn.au