GRUB vs. Custom
GRUB vs. Custom
simple question: should my kernel rely on GRUB to do A20 and Protected Mode? Should I have extra code just in case?
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:GRUB vs. Custom
Hi,
If you ever want to reliably/intelligently set a decent video mode before booting your OS, then you may want to write your own boot loader (a useful feature unless you've written a pile of video drivers). Alternatively you can boot with GRUB, switch back to real mode, change the video and switch back to protected mode.
IMHO if you have enough experience to write an OS, then writing a custom boot loader will only take a week or so part time. If you don't have enough experience to write an OS, then writing a custom boot loader will help gain experience.
It's also possible to boot from GRUB and your own custom boot loader/s, rather than being restricted to one way or the other. See my OS's boot loader source code for details - http://www.users.bigpond.com/sacabling/dl.html (about 3/4 of the way down under "Boot Loader Package")..
Cheers,
Brendan
If you ever decide to write your own boot loader/s (ie. stop using GRUB), then you'd need to write code for A20 and switching to protected mode.Dragon_Hilord wrote: in that case, should I /ever/ write the a20 and PM code?
(planning ahead)
If you ever want to reliably/intelligently set a decent video mode before booting your OS, then you may want to write your own boot loader (a useful feature unless you've written a pile of video drivers). Alternatively you can boot with GRUB, switch back to real mode, change the video and switch back to protected mode.
IMHO if you have enough experience to write an OS, then writing a custom boot loader will only take a week or so part time. If you don't have enough experience to write an OS, then writing a custom boot loader will help gain experience.
It's also possible to boot from GRUB and your own custom boot loader/s, rather than being restricted to one way or the other. See my OS's boot loader source code for details - http://www.users.bigpond.com/sacabling/dl.html (about 3/4 of the way down under "Boot Loader Package")..
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re:GRUB vs. Custom
well, if I were /ever/ to make my own bootloader it would do just that: boot and load. the kernel would handel the rest.
Thanks guys!
Thanks guys!
-
- Member
- Posts: 1600
- Joined: Wed Oct 18, 2006 11:59 am
- Location: Vienna/Austria
- Contact:
Re:GRUB vs. Custom
One can also use vm86 or writing directly to registers to switch to graphics mode - I'd rather do it the vm86 way for the first time. It is not *that* awful to incorporate a vm86 module in the kernel. It just requires some cross thinking and some tricks.
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
BlueillusionOS iso image