[Freedos-kernel] possible to disable initdisk?
I'm in a situation where I got Syslinux bootloader on an USB flash drive. It loads the MEMDISK ramdisk module with a floppy image as contents which is then executed (as drive A:). I'd like to get into a situation where the USB flash disks doesn't get a driveletter assigned by the kernel when it loads but only after the DOS USB driver stack is loaded. To that end there seem to be 2 options: 1) /memdisk initrd=floppy.img pause followed by removing USB disk and pressing a key to continue. Later on, insert again. 2) keep kernel disk scanning/enumerating code intact but don't execute it for drive 0x80 and up, at startup at least. This way the drivers can be loaded, set interface to max supported speed, recognise devices, and get a driveletter assigned (C: likely) Is the kernel designed to allow such a specific scenario #2 ? It's very un-DOS-like to delay giving out driveletters. Initdisk.c seems to suggest scanning can be disabled [SCAN_PRIMARY], but I guess that's a permanent option instead of only for boot-time. -- Get a FREE DOWNLOAD! and learn more about uberSVN rich system, user administration capabilities and model configuration. Take the hassle out of deploying and managing Subversion and the tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2 ___ Freedos-kernel mailing list Freedos-kernel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-kernel
Re: [Freedos-kernel] possible to disable initdisk?
Hoi Bernd, I'm in a situation where I got Syslinux bootloader on an USB flash drive. It loads the MEMDISK ramdisk module with a floppy image as contents which is then executed (as drive A:). I'd like to get into a situation where the USB flash disks doesn't get a driveletter assigned by the kernel when it loads but only after the DOS USB driver stack is loaded. You can hook int 13 function 8 (get drive parameters) and make sure that for dl = 80 or higher, it always returns carry set and dl = 0 to pretend having no harddisks. Of course DOS does a lot of work for you to parse partitions, so it is a bit odd to pretend you have none only to do that again manually later. To that end there seem to be 2 options: 1) /memdisk initrd=floppy.img pause followed by removing USB disk and pressing a key to continue. Later on, insert again. You could also do the above and/or temporarily make int 13 access to all harddisks behave as if all disks are empty bit buckets. I hope you will not try to format later ;-) 2) keep kernel disk scanning/enumerating code intact but don't execute it for drive 0x80 and up, at startup at least. This way the drivers can be loaded, set interface to max supported speed, recognise devices, and get a driveletter assigned (C: likely) See above. You can do it with a relatively simply int 13 fake. Is the kernel designed to allow such a specific scenario #2 ? There is no built-in function in the kernel, although you can SYS CONFIG the lba support away and hide your partitions after the first 1024 cylinders. Later, when you load USB drivers to do the processing on DOS block device level, you can get along completely without int 13 CHS / LBA access anyway, depending on what style of USB drivers you use, I guess. Again, in this scenario, the USB driver will have to do all partition table (MBR, chain of extra partitions) processing itself because DOS and int 13 itself has not int 13 disk hot-plugging. Luckily it is okay for DOS to have many drive letters managed by 1 driver. It's very un-DOS-like to delay giving out driveletters. Initdisk.c seems to suggest scanning can be disabled [SCAN_PRIMARY], but I guess that's a permanent option instead of only for boot-time. The scan constants are only for doing some things in some passes of scanning the partition table and other things in other, with some things being skipped then. It is not about skipping disks. Eric :-) -- Get a FREE DOWNLOAD! and learn more about uberSVN rich system, user administration capabilities and model configuration. Take the hassle out of deploying and managing Subversion and the tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2 ___ Freedos-kernel mailing list Freedos-kernel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-kernel
Re: [Freedos-kernel] possible to disable initdisk?
Op 22-8-2011 0:47, Eric Auer schreef: You can hook int 13 function 8 (get drive parameters) and make sure that for dl = 80 or higher, it always returns carry set and dl = 0 to pretend having no harddisks. Of course DOS does a lot of work for you to parse partitions, so it is a bit odd to pretend you have none only to do that again manually later. No idea how to do such a thing, all modifications would have to happen at the kernel I guess as that's the first thing loading, and actually assigning those driveletters. Then, again, Syslinux/memdisk documentation lists a nopassany parameter to disable showing harddisk. Gotta test that next I guess :) You could also do the above and/or temporarily make int 13 access to all harddisks behave as if all disks are empty bit buckets. I hope you will not try to format later ;-) I've had a DIR E: at some point and ended up with batchfile content being listed. Talk about memory corruption.. There is no built-in function in the kernel, although you can SYS CONFIG the lba support away and hide your partitions after the first 1024 cylinders. Later, when you load USB drivers to do the processing on DOS block device level, you can get along completely without int 13 CHS / LBA access anyway, depending on what style of USB drivers you use, I guess. Again, in this scenario, the USB driver will have to do all partition table (MBR, chain of extra partitions) processing itself because DOS and int 13 itself has not int 13 disk hot-plugging. Luckily it is okay for DOS to have many drive letters managed by 1 driver. The USB drive is typically formatted with FAT32 so all FAT32/LBA code needs to stay intact or I can't access the filesystem on the USB flash drive after loading drivers. Using a FAT16 kernel would've been too easy, hehe. The scan constants are only for doing some things in some passes of scanning the partition table and other things in other, with some things being skipped then. It is not about skipping disks. There's an option for *showing* partition info (of which the output is can't get partition info half of the time anyway), as well as an option for the scan order (MSDOS style, or general style), unfortunately nothing for only scanning partial stuff. I'll try the Syslinux stuff for starters, see if it works. Thanks for your response -- Get a FREE DOWNLOAD! and learn more about uberSVN rich system, user administration capabilities and model configuration. Take the hassle out of deploying and managing Subversion and the tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2 ___ Freedos-kernel mailing list Freedos-kernel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-kernel
Re: [Freedos-kernel] possible to disable initdisk?
Op 22-8-2011 0:58, Bernd Blaauw schreef: Then, again, Syslinux/memdisk documentation lists a nopassany parameter to disable showing harddisk. Gotta test that next I guess :) This works like a charm, however FreeDOS kernel happily lists about 50 lines with 'illegal partition table, drive nn, sector 00' FDISK also results in errorlevel 6 (no harddisk present) as intended. The USB driver stack seems to work except for happily killing keyboard input upon access to the USB drive. Not tested FDISK yet. Anyway, one issue semi-solved by 'nopassany' parameter, sleep well :) -- Get a FREE DOWNLOAD! and learn more about uberSVN rich system, user administration capabilities and model configuration. Take the hassle out of deploying and managing Subversion and the tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2 ___ Freedos-kernel mailing list Freedos-kernel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-kernel