This code uses the old way of using interrupts, which, according to BP, should work, but there is a new, better way.
Essentially, with the old way, you did "stp", and set up the IDT, which looked like [offset,32,offset,32,...]. Now you use "stef" and the IDT is [offset,segment,0,32,offset,segment,0,32,...].
My programs: BIOS - Alcyone - Calculator - Notepad - Movie Player
My tutorials: applyTorque - Quaternions - PID controllers
Some other things I made: FT Chip - RK4 Solar System
http://tiny.cc/OMFGWTFBBQ
Best People On Wiremod!
Black Phoenix, Azrael, Jat Goodwin, Magos Mechanicus, ITSBTH, Fizyk, g33v3s,tuusita, InfectiousFight, ief015
Pointless things that are pointless, are pointlessly pointless, therefore pointlessness is pointless.
So pointlessly pointing out the pointlessness of this pointless signature is utterly pointless.
My IQ is 123
I took the code from Hitman's post and modified it to work with the new interrupts:
Actually, as I look at it now, I don't see what is its point. After initializing interrupts, it jumps to the part that increases value of port 0 by 0.001 each execution. Only when you input 32 to the NMI input of the CPU, it would output 1337 for a while, but it will be quickly overwritten by the increasing eax in the "Idler" part.Code:stef jmp Init Interrupt_Table: alloc 1024 //now it's 4 bytes for each interrupt Init: sti lidtr Interrupt_Table mov ebx,Interrupt_Table add ebx,128 //the same - 4 bytes, so 32*4 mov #ebx,Int_Start inc ebx mov #ebx,0 //now we have to put the segment too - usually it will be 0, unless you mess with segments in a more advanced way inc ebx mov #ebx,0 //not really needed, as alloc initializes memory with 0's, but I put it here to show the idea inc ebx mov #ebx,32 //the last byte, 32 indicates that the interrupt is present jmp Idler Int_Start: cli out 0,1337 nmiret Idler: add eax,0.001 out 0,eax jmp Idler
My programs: BIOS - Alcyone - Calculator - Notepad - Movie Player
My tutorials: applyTorque - Quaternions - PID controllers
Some other things I made: FT Chip - RK4 Solar System
That's exactly what the problem was with the origional code. It would increment the number, and when you pressed the button it would interrupt but only once, then wouldn't interrupt again.
I'll give it a shot and see what I get!
http://tiny.cc/OMFGWTFBBQ
Best People On Wiremod!
Black Phoenix, Azrael, Jat Goodwin, Magos Mechanicus, ITSBTH, Fizyk, g33v3s,tuusita, InfectiousFight, ief015
Pointless things that are pointless, are pointlessly pointless, therefore pointlessness is pointless.
So pointlessly pointing out the pointlessness of this pointless signature is utterly pointless.
My IQ is 123
It won't interrupt again, because the first thing the interrupt routine does is... disable the interrupts (cli). So after interrupting once, the interrupts are disabled and you won't be able to trigger the NMI any more.
My programs: BIOS - Alcyone - Calculator - Notepad - Movie Player
My tutorials: applyTorque - Quaternions - PID controllers
Some other things I made: FT Chip - RK4 Solar System
So...lemme summarize this and see if I have it right...the interrupt table is now 1,024 bytes in size, and each interrupt has 4 spaces associated with it. The first space specifies the address of the code that is to be executed when the interrupt is called. Second is...a segment offset? If I'm correct? And what are the official purposes of the third and fourth ones? I saw that the last one always had a 32 in there but I remember seeing SOMEwhere on this site that you could also specify an 8 or a 16 for different purposes. What is the REASON that there is a 32 there?
Byte 0: IP that will be set when interrupt occurs (entrypoint, where to jump)
Byte 1: CS that will be set when interrupt occurs (offset of executed code, code segment)
Byte 2: Reserved, must be zero
Byte 3: Flags
Flags are following (bit numbers):
Code:3 [8 ] = CMPR shows if interrupt occured (CMPR will be set to 1 if this interrupt exists, and to -1 if this interrupt does not exist) 4 [16] = Interrupt does not set CS (code segment wont be set) 5 [32] = Interrupt enabled 6 [64] = NMI interrupt (is this NMI interrupt?)
What if you wanted to use more than one? What if you wanted an NMI interrupt where the Code Segment wouldn't apply?
Ahhhhhhhhhhhhh, I get it now...thanks!
Bookmarks