Re: Anyone tried to code their own bootloader ?
Posted: Fri Jul 25, 2008 1:34 am
Well it does, you tell grub which files with the directive "module".Masterkiller wrote:I suppose it doesn't load any drivers.
The Place to Start for Operating System Developers
https://f.osdev.org/
Well it does, you tell grub which files with the directive "module".Masterkiller wrote:I suppose it doesn't load any drivers.
zerosum wrote:I wrote a crap one. Now I use GRUB
I wrote a crappy boot loader, then I wrote a better one, then I wrote an even better one...Omega wrote:Me too man. . .me too
What are those?I'm supporting features that GRUB couldn't hope to allow
GRUB can load non-unix operating system but you cannot build GRUB on a non-unix operating system. So if you are using GRUB you'll have to implement or port a unix toolchain in order to compile GRUB on your operating system.blackcatcoder wrote:@Brendan : Using GRUB doesn't mean that you write a Unix clone, what a small horizont. GRUB is a very good bootloader which gives you the basic features. What follows after GRUB is up to YOU!
Precisely - the boot loader is easy to support, but for an OS like mine the boot loader's installer would need to be completely rewritten, and even if I ignore the other issues it's still easier for me to write my own boot loader/s and installer/s than to rewrite GRUB's installer.Korona wrote:GRUB can load non-unix operating system but you cannot build GRUB on a non-unix operating system. So if you are using GRUB you'll have to implement or port a unix toolchain in order to compile GRUB on your operating system.blackcatcoder wrote:@Brendan : Using GRUB doesn't mean that you write a Unix clone, what a small horizont.
For me, what follows after GRUB is switching back to real mode so I can setup a default video mode and do the memory detection myself using BIOS functions (so that I don't need to rely on the relatively dodgy memory detection done by GRUB). For floppies, this means GRUB consumes 104 KB and the only thing I use it for is reading data from disk and enabling A20 - I can do the same with about 1 KB of code, without the need for additional code to return to real mode (IE. for floppies, GRUB costs over 100 times more space than necessary, which leaves less space for my boot image). For hard drives, netboot/PXE, CD-ROM, etc it's not much different - same problem as floppies (but space and time spent loading data isn't as much of an issue).blackcatcoder wrote:GRUB is a very good bootloader which gives you the basic features. What follows after GRUB is up to YOU!
My latest code supports redundant floppy images, where the same data is stored on both sides of a 2 sided disk so that the boot loader can read from the second side if there's read errors on the first side. This means that if the floppy has lots of bad sectors, as long as the boot sector itself is readable then my chances of successfully booting are a *lot* better. This also halves the maximum amount of data I can store on the floppy, but if a boot floppy only needs 720 KiB of data it's worth doing IMHO (as floppies are the most unreliable storage media I've ever used).Adek336 wrote:What are those?I'm supporting features that GRUB couldn't hope to allow
You're embarrased over that? You should see my bootloader, I do pretty much none of that caliber stuff in my bootloader. The most sophisticated thing my bootloader does is parse a config file from a disk image with my own filesystem on it. Unfortunately, it is almost all completely hardcoded in this respect... it only supports reading clusters using INT 0x13 and the disk at 0x80. It does support figuring out the cluster size and other details of the filesystem, but that's about it. All it can do so far is set up unreal mode and A20, parse a config file to find the kernel and load it to memory.AJ wrote:Blimey, Brendan!
I know you need patience for OS Dev, but you just have more than most! That spin on using both sides of a floppy disk is very nice. I'm now embarrased to say that my custom boot loader (which I was hoping to release to the OSDev community one day) currently does precisely no memory error checking.
I've just seen my TODO list double in size after reading that.![]()
Cheers,
Adam