system reboots when executing an int inside the before creat

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.
Freanan

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

Post 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?
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

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

Post 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.
Freanan

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

Post by Freanan »

I added

Code: Select all

[ORG 0x1000]
Now it works ;D!

Thank you very much!!!
Therx

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

Post 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
Post Reply