Home Page | News | Documents | Screenshots | DexOS team | Downloads | Links | Forum


Bootprog manual

DexOS bootloader This is the program DexOS use's to boot from, i have included the text from 'BOOTPROGS' manual for info only, as you will not need to do any of the below, if using 'bootprog' with DexOS, as we have made a self extrating exe to do the job of putting it on a floppy for you, if you are a OS dev then 'bootprog' is the best bootloader, we have come across and is the only bootloader we would use, it's a program by 'Alexei A. Frounze', written in nasm, we have converted it to fasm, of which the code is available to anyone, the nasm ver is available from Alexei's web site in the links section.

Description What is the "BOOTPROG" boot sector? It's a boot sector for FAT12 floppy diskettes both 3.5 and 5.25 inch. This boot sector can load and run any standard MSDOS COM or EXE program placed to the root directory of the disk.

What it maybe used for? Well, it may be used for loading a custom OS kernel (orkerenel loader). It also may be used for simple running of PMode programs that need Privilege Level 0, but user has WindowsNT with NTFS on his computer. He has no other way
of doing that (NT doesn't allow to run such programs, there is no anyhing similar to the "command prompt only" boot option in Win9x and harddisk is not accessible).
If you're interested in how bootstrap, BIOS Int 13h and FAT12 work, you may learn from the boot sector sourcecode. :)

What it can't be used for Since the boot sector loads COM and EXE programs, it also can load and run any existing MSDOS program such as Norton Commander, for example. But I think you understand that this boot sector doesn't provide any DOS service... So don't play a fool and don't try to perform an Int 21h instruction until you load MSDOS. Use BIOS service instead. BIOS provides keyboard and screen I/O as well as DOS.
It can't be used for hard disks because it has support for FAT12 only and there is not much space to fitting code that works with HDD partitions and different FAT types (Windows9x FAT32, for example).

How does it work? Yeah, it really works... Nothing unusual... It just looks for a program file name at the root directory and loads corresponding file with following execution. If the boot sector fails to read any other sector, it prints a very short message ("RE") to the screen and hangs the computer. If the boot sector fails to find needed program in the root directory, it also hangs with another message ("NF"). "RE" stands for "Read Error" "NF" stands for "file Not Found"
COM and EXE programs are executed standard way just like in MSDOS. Program stack is also setup depending on file type ("MZ" signature inside the program file stands for EXE file).
Program file is loaded to the 60h segment by default. See source code for details about computer memory layout.
NOTE: you may not format your diskette for future storing of files after installing the new boot sector. An original boot sector of the diskette stays good for that, sice no serious information is changed.

How to make my disk bootable with this new boot sector ? Nothing special. Just get any already formatted diskette. You may format it either in MSDOS or Windows 9x or Windows NT. Under WinNT select FAT12 type for formatting. You may use diskettes of any capacity and any sizes. The boot sector works the same on 3.5 and 5.25 inch disks and it doesn't care about disk space. It maybe a 720KB or 360KB disk as well as 1.44MB or 1.2MB.
Btw, you don't need to kill all the files on the diskette. You may don't delete them at all, if there is enough space for a program that will be loaded by the boot sector. I remember how MSDOS boot sector works. :) It can't load system files, if they are not the very first files on the disk. What the hell MS did such a bullshit, huh ??? My boot sector loads a program normally regardless of the
place where it starts on the disk and regardless of the chaos on the disk (I mean files on the disk may be fragmented. If you don't know what this means, read some manual where described what DOS/Windows9x DEFRAG.EXE program is).
OKay, we have got a formatted FAT12 diskette. What's next? Follow these commands:
1. Put the diskette to a floppy drive ("A:" or "B:"). Let's say to "A:".
2. Run the BOOTABLE.EXE utility as follows: BOOTABLE BOOT12.BIN A:
This means read new boot sector from the BOOT12.BIN file and put it directly to the diskette in the drive "A:".
3. Copy any existing COM/EXE program that doesn't use DOS service to the diskette and rename it to the STARTUP.BIN file.
4. Reset the computer.
5. Enter the BIOS setup by pressing the DEL key.
6. Find the Advanced Setup section and choose bootstrap order that starts with the "A:" disk
7. Exit BIOS setup and the computer will reboot.
8. Sit and wait for your program.
9. If everything is OK, you see how your program works, cry "I've got it! Yes! Yes! Yes!" very loudly so that every neighbour can hear you. :))
10. If you see either "RE" or "NF" message on the screen, your disk is faulty or you have made a mistake somewhere - file named as STARTUP.BIN doesn't exest.

Important note: Be sure that your program is indeed named as STARTUP.BIN
but not as STARTU~1.BIN which may happen under Windows. Check this by the
"dir" command wich shows 8.3 short DOS names as well as LFNs of Windows.
In order to load your MSDOS or Windows, simply choose a bootstrap order starting with the "C:" disk, where your OS lives. If it lives on any other disk, choose appropriate order of bootstrap in the BIOS setup.