flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > where shold i put my IDT? HELP!? |
Author |
|
bogdanontanu 08 Dec 2005, 18:04
The place and location of the IDT in memory is of no importance whatsoever. ANY 16bytes aligned address will do. After that "dd" you must place "offset my_own_idt_table".
Of course depending on the OS memory layout, the loading sequence and author personal preferences combined with the "phases of the moon at Edora" and the number of hair pulled divided by "something" ... THIS value might be anything . Changing somebody else's OS source without understanding is the correct path to FRUSTRATION. It works ok just until you hit some conceptual barrier; after that you will need more hair to pull off. Seriousely without knowing the way that FritzOS is loaded into memory (see that 0x20000 added to GDT?) and the original author's preferences and understanding the sources --> there is no way of telling The basic concept / ideea is that the IDT can be placed anywhere. If you want to return to BIOS real mode you should avoid the original realmode IDT location (aka 0). Depending on OS specifics... |
|||
08 Dec 2005, 18:04 |
|
archie 08 Dec 2005, 18:58
thanks i give the address like you said and made a little more organization and now my interrupts are working
|
|||
08 Dec 2005, 18:58 |
|
darius 08 Dec 2005, 19:36
hello I need an simiar help
I have similar problems about GDT from fritzOS and I am also an newbie in os development subjects.. I have an GDT set up definition in an kernel.asm but I used some different codes from internet. in my original kernel.asm, the GDT is like that : I have this GDT: -------------------------------------------------- ; GDTR ; Make a new GDT for the IDT ; Global Descriptor Table: This tells the computer where all the segments ( now selectors ) are. GDTR dw gdt_end-1 dd gdt+0x20000 gdt nullsel equ $-gdt gdt0 dd 0 dd 0 CodeSel equ $-gdt dw 0ffffh dw 0 db 2 db 09ah db 0cfh db 0h DataSel equ $-gdt dw 0ffffh dw 0h db 2h db 092h db 0cfh db 0 gdt_end ; End of GDTR -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- but in this code that I used ,the GDT set up like that so the IDT and LDT definition based on this definitions: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gdt: ; NULL descriptor dw 0 ; limit 15:0 dw 0 ; base 15:0 db 0 ; base 23:16 db 0 ; type db 0 ; limit 19:16, flags db 0 ; base 31:24 ; unused descriptor dw 0 dw 0 db 0 db 0 db 0 db 0 LINEAR_DATA_SEL equ $-gdt dw 0FFFFh dw 0 db 0 db 92h ; present, ring 0, data, expand-up, writable db 0CFh ; page-granular (4 gig limit), 32-bit db 0 LINEAR_CODE_SEL equ $-gdt dw 0FFFFh dw 0 db 0 db 9Ah ; present,ring 0,code,non-conforming,readable db 0CFh ; page-granular (4 gig limit), 32-bit db 0 gdt_end: gdt_ptr: dw gdt_end - gdt - 1 dd gdt --------------------------------------------------------------------------------------------------------------------------------------------------------------- SO first I tried simply changing the first GDT definition to second one.But this does not work. I looked up the loader.asm of my code.And there is some operation on GDT in loader.asm too. So my question is : how can I change my first GDT definition to second one..is there any special method?? first as I sad,i simply copied +pasted last one; but then cpu loop forever. what should I consider for changing??? thank you very much for all help.... |
|||
08 Dec 2005, 19:36 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.