flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Falling over at the first hurdle! |
Author |
|
Artlav 07 Aug 2006, 15:24
My guess is that because IDT is not defined, first timer interrupt causes a triple fault.
Try reading tutorials about interrupts in PM. |
|||
07 Aug 2006, 15:24 |
|
cod3b453 07 Aug 2006, 15:47
The first thing you need to do after switching to protected mode is set the ds,es and ss selectors and set esp for good measure. This means you will need a data descriptor in your GDT.
Code: use32 HereWeGo: mov ax,0x0010 ; offset of data selector in GDT mov ds,ax ; setup selectors mov es,ax ; mov ss,ax ; mov esp,0x00008000 ; location of stack The next problem is I don't think you can enable interrupts again until you have loaded an IDT with 32bit selectors and ISR handlers (this is where I am stuck at the moment, so I can't help any more than that ). HTH |
|||
07 Aug 2006, 15:47 |
|
Just me 07 Aug 2006, 16:30
Hi all,
Thanks for the quick reply's. I now see the error of my ways. 'codeb453' i was just look at the code you posted. I thought there was a difference in the make up of a selector for data an the stack. You seem to be using the 0x10 selector for the stack as well as data! |
|||
07 Aug 2006, 16:30 |
|
cod3b453 07 Aug 2006, 18:31
Yes, you can define separate selectors for data and stack, if you want them to behave differently, if not, they can use the same selector because they both handle data and can have the same properties.[/code]
|
|||
07 Aug 2006, 18:31 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.