Page 2 of 2

Re:system reboots when executing an int inside the before cr

Posted: Wed Aug 20, 2003 7:16 am
by Freanan
It is loaded at 1000h.

PS: I write my floppy-image to the floppy with rawrite.
But it always causes my system to hang in the end.
So might it be that rawrite crashes befor it wrote ALL of the data to the floppy and so the beginning of my code is executed, but it crashes, because the isr is not written to the floppy?

Re:system reboots when executing an int inside the before cr

Posted: Wed Aug 20, 2003 8:04 am
by Pype.Clicker
hmm ... if your code is loaded at 0x1000 (i assume this is real-mode segment 0x1000, thus physical address 0x0001_0000,
- either you have code segment.base=0x0001_0000, which means when you program LIDT, you must make sure to fill it with a linear (i.e. physical) address, thus you need some kind of

Code: Select all

add [idt+2],0x00010000
- either you have code segment.base=0x0000_0000 in which case it is wrong to put 0x0000_00A8 as your selector offset and you should rather use an

Code: Select all

[ORG 0x00010000]
, but this means you can no longer have

Code: Select all

dw handler
(the constant will be too large)
.

Hope this helps.

Re:system reboots when executing an int inside the before cr

Posted: Wed Aug 20, 2003 9:17 am
by Freanan
I added

Code: Select all

[ORG 0x1000]
Now it works ;D!

Thank you very much!!!

Re:system reboots when executing an int inside the before cr

Posted: Wed Aug 20, 2003 1:52 pm
by Therx
A800 -my handler adress
0800 -the 0x08, my codesegmentselector
00 -the 0-byte
8E -the flags
0000 -the other part of the handler
Beware when you use memory above 1mb this will have to change to:-

Code: Select all

Low 16bits of handler address     (word)
Code Segment Selector                (word)
Null Byte                                       (byte)
Flags                                             (byte)
High 16bits of hander address     (word)

TOTAL 8 bytes
Pete