Hi! all,

I'm writing a piece of 'glue' code which is to connect GRUB's booting process
and our newly developed OS kernel.

Our kernel uses another GDT Table instead of which GRUB provides. So I wrote
the following codes to switch GDT register. Base address of code segment in the
new GDT is assumed to be CODE_BASE (and the old one is 0, defined by GRUB). 
This codes are compiled under M$'s masm.exe:

;; ...
;; initialize GDT and its pointer

        lgdt    gdt_pointer

        db      0eah                    ;; machine code for jmp seg16:offset32
        dd      offset  lUseNewGdt      ;; offset32. just the physical addr.
        dw      - CODE_BASE             ;; seg16

lUseNewGdt:
        ;; ...
        ;; more codes under new GDT
        
        
But why the machine always reboots whenever it reaches that jmp instruction?
I swear that the GDT and it's pointer are set properly, and 'offset lUseNewGdt'
is the right physical address.

BTW, 1. Is there any other way to switch GDT and go on running?
     2. Has GRUB supported CPUs other than Ix86? 
     thanks!




Best regards,
Wang Weihan


_______________________________________________
Bug-grub mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-grub

Reply via email to