Hey guys, so I've scoured the internet for information for GRUB, and I must be reading something wrong because it seems like everything is conflicting information.
When I use GRUB to load my OS, do I need to do anything related to protected mode? Is that handled by GRUB? What about the A20 line?
Thanks!
Clarification of GRUB's usage
Well, yes, you still will have to deal with some aspects of protected mode.
GRUB (but only when loading a multiboot-compliant kernel, IIRC) will enter protected mode, enable the A20 line, etc. for you. When it loads your OS, its already running in segmented protected mode.
However, most people will want to change GRUB's default pmode environment, so they load their own GDT, implement paging, V86, multitasking, etc. - so there's still much to do after GRUB loads your kernel.
You might be interested in the GRUB wiki article.
Hope this helps!
GRUB (but only when loading a multiboot-compliant kernel, IIRC) will enter protected mode, enable the A20 line, etc. for you. When it loads your OS, its already running in segmented protected mode.
However, most people will want to change GRUB's default pmode environment, so they load their own GDT, implement paging, V86, multitasking, etc. - so there's still much to do after GRUB loads your kernel.
You might be interested in the GRUB wiki article.
Hope this helps!
"Sufficiently advanced stupidity is indistinguishable from malice."
No - GRUB loads you in protected mode, but in a minimal protected mode, so no paging, flat segments etc. It's possible you may want to change the environment GRUB starts you in to match your own wants/needs.samoz wrote:Very much! Thanks you!
You said that I would want to change the default pmode environment, by that do you mean making changes in GRUB while still in real mode? Or am I misunderstanding?
Have you had a look at the multiboot header, in the GRUB / Multiboot specification? It should tell you pretty exactly what you can and cannot do with it.
Did you have a look at the Intel manuals, and an overall idea of what e.g. a GDT is about (and how to change one)?
Did you have a look at the Intel manuals, and an overall idea of what e.g. a GDT is about (and how to change one)?
Every good solution is obvious once you've found it.
I don't think I know what I mean lolIt depends on what you mean by "the way GRUB boots me". What exactly do you need to change?
I meant mostly your reference to a lack of paging and flat segments in an earlier post. Is the multiboot header where I can enable stuff like that?
I'll look into it a little more and actually sit down for a thorough read of the multiboot specs when I have some free time and I'm sure more questions will pop up at that time about specifics.
No - GRUB loads you with flat segments and no paging. It's up to you to enable them if you so choose.samoz wrote:I don't think I know what I mean lolIt depends on what you mean by "the way GRUB boots me". What exactly do you need to change?
I meant mostly your reference to a lack of paging and flat segments in an earlier post. Is the multiboot header where I can enable stuff like that?
I'll look into it a little more and actually sit down for a thorough read of the multiboot specs when I have some free time and I'm sure more questions will pop up at that time about specifics.