MoS Boot Loader
Posted: Sat Dec 13, 2008 5:21 pm
Hey everyone,
As some of you may know I have been rewriting my bootloader from scratch. I wanted to give it a very clean design and easy to add features and extend on.
MoS Boot Loader - Design
MoS is a typical two stage boot loader composed of three programs. Stage1 (Stage1.sys) is a flat binary program that loads and executes the 2nd stage image (KRNLDR) depending on the media type and file system type that Stage1 is meant to work with. The MBR program is responsible for loading the boot sector on the primary boot partition and is also coinsidered a stage 1 program.
KRNLDR is a image file composed of two programs: the Startup Module (Startup.sys) and OSLoader.exe. Startup.sys puts the system into protected mode and basic system initialization. It also provides a 32bit<>16bit interface to call the BIOS from protected mode as well as interfacing for EFI firmware (Once implemented anyway). It also executes the 2nd program within itself--OSLoader, and passes boot time information (Boot drive, Boot filesystem) to it as well as its 16bit interface routine, io_services).
OSLoader.exe is the core of the bootloader written in Microsoft Visual C++ 2008. It provides abstract interfaces for different file system types, media types, network booting, boot menu, chain loading support, internal command parser, and optional boot time utility programs. It uses io_services passed from the startup module for calling BIOS or EFI routines from protected mode.
OSLoader.exe and Startup.sys are merged together using a small program I made into the KRNLDR image file that is loaded by a Stage1 program.
Features
Currently lacking in features, but here you go:
>Stage1 for FAT12 floppy media and MBR is completed
>Startup.sys is completed
>Enters protected mode very early to aid in catching problems using its IDT
>Portable: Works in tested laptops, PCs, Virtual PC, and all tested versions of Bochs
>OSLoader has FAT12 support and an abstract file system interface. Soon to support FAT16 and FAT32
>Internal command parser
Features soon to come:
>Full multi boot compliance;
>More filesystems that we will look at: fat16, fat32, etfs, hpfs, ntfs
>Full partitioning support (Its not fully implemented yet)
>More media boot devices: CD, DVD, USB, HDD, Full network booting support
>More Boot time utility support: I have a few boot time programs in mind that can be useful...
>Chain loading implementation
Screenshots
Here is the boot loaders main menu. It provides several boot time options that can be added to via the internal command parser.
Heres the internal command parser running different commands. Some of these commands will be changed though as to provide an easier way of working with boot time configuration and to allow running boot time scripts:
Im not releasing it yet as it is not yet ready for release. I want to see if I can throw in a few more features before its first release. Let me know what you think and if there are anything you would like added
I am also looking for comments on its design. ie; improvements? Is it a good design? Any form of feedback is always helpful
As some of you may know I have been rewriting my bootloader from scratch. I wanted to give it a very clean design and easy to add features and extend on.
MoS Boot Loader - Design
MoS is a typical two stage boot loader composed of three programs. Stage1 (Stage1.sys) is a flat binary program that loads and executes the 2nd stage image (KRNLDR) depending on the media type and file system type that Stage1 is meant to work with. The MBR program is responsible for loading the boot sector on the primary boot partition and is also coinsidered a stage 1 program.
KRNLDR is a image file composed of two programs: the Startup Module (Startup.sys) and OSLoader.exe. Startup.sys puts the system into protected mode and basic system initialization. It also provides a 32bit<>16bit interface to call the BIOS from protected mode as well as interfacing for EFI firmware (Once implemented anyway). It also executes the 2nd program within itself--OSLoader, and passes boot time information (Boot drive, Boot filesystem) to it as well as its 16bit interface routine, io_services).
OSLoader.exe is the core of the bootloader written in Microsoft Visual C++ 2008. It provides abstract interfaces for different file system types, media types, network booting, boot menu, chain loading support, internal command parser, and optional boot time utility programs. It uses io_services passed from the startup module for calling BIOS or EFI routines from protected mode.
OSLoader.exe and Startup.sys are merged together using a small program I made into the KRNLDR image file that is loaded by a Stage1 program.
Features
Currently lacking in features, but here you go:
>Stage1 for FAT12 floppy media and MBR is completed
>Startup.sys is completed
>Enters protected mode very early to aid in catching problems using its IDT
>Portable: Works in tested laptops, PCs, Virtual PC, and all tested versions of Bochs
>OSLoader has FAT12 support and an abstract file system interface. Soon to support FAT16 and FAT32
>Internal command parser
Features soon to come:
>Full multi boot compliance;
>More filesystems that we will look at: fat16, fat32, etfs, hpfs, ntfs
>Full partitioning support (Its not fully implemented yet)
>More media boot devices: CD, DVD, USB, HDD, Full network booting support
>More Boot time utility support: I have a few boot time programs in mind that can be useful...
>Chain loading implementation
Screenshots
Here is the boot loaders main menu. It provides several boot time options that can be added to via the internal command parser.
Heres the internal command parser running different commands. Some of these commands will be changed though as to provide an easier way of working with boot time configuration and to allow running boot time scripts:
Im not releasing it yet as it is not yet ready for release. I want to see if I can throw in a few more features before its first release. Let me know what you think and if there are anything you would like added
I am also looking for comments on its design. ie; improvements? Is it a good design? Any form of feedback is always helpful