Pmode position after boot with grub

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
Brill

Pmode position after boot with grub

Post by Brill »

Hi, im using grub to boot my kernel.
Grub switches to pmode before it makes the jump to any os. So, what is the position of the descriptor tables? What do they contain? And are hard interrupts enabled?

I'm only asking cos the online Grub manual doesn't say anything about this. :/

Regards Brill.
carbonBased

RE:Pmode position after boot with grub

Post by carbonBased »

Upon entry to the 32-bit kernel:
1. CS points to a code segment descriptor with base address 0
   and limit 4 gig - 1
2. DS, SS, ES, FS, and GS point to a data segment descriptor
   with base address 0 and limit 4 gig - 1
3. A20 is enabled
4. Paging is disabled
5. Interrupts are disabled. No IDT is defined.
6. The size and location of the GDT and selector values are
   undefined. Your kernel should create it's own GDT as soon
   as possible.
7. EAX=0x2BADB002
8. EBX contains the linear address of (i.e. a pointer to) a
   block of system and bootstrap information:

        /* The Multiboot information.  */
        typedef struct multiboot_info
        {
          unsigned long flags;
          unsigned long mem_lower;
          unsigned long mem_upper;
          unsigned long boot_device;
          unsigned long cmdline;
          unsigned long mods_count;
          unsigned long mods_addr;
          union
          {
            aout_symbol_table_t aout_sym;
            elf_section_header_table_t elf_sec;
          } u;
          unsigned long mmap_length;
          unsigned long mmap_addr;
        } multiboot_info_t;
Brill

RE:Pmode position after boot with grub

Post by Brill »

Thanks. :D

Regards, Brill
Post Reply