GRUB vs. Custom

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
dh

GRUB vs. Custom

Post by dh »

simple question: should my kernel rely on GRUB to do A20 and Protected Mode? Should I have extra code just in case?
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:GRUB vs. Custom

Post by Pype.Clicker »

you can trust GRUB for that.
dh

Re:GRUB vs. Custom

Post by dh »

thanks Pype. I needed that to know if it was worth my time right now.
dh

Re:GRUB vs. Custom

Post by dh »

in that case, should I /ever/ write the a20 and PM code?
(planning ahead)
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re:GRUB vs. Custom

Post by Brendan »

Hi,
Dragon_Hilord wrote: in that case, should I /ever/ write the a20 and PM code?
(planning ahead)
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.

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.
dh

Re:GRUB vs. Custom

Post by dh »

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!
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:GRUB vs. Custom

Post by distantvoices »

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
Post Reply