i cant find any info on idt's in real mode. I have read that a rm idt has 4 byte entries, and a pm idt has 8 byte, but i dont know what the fields are for real mode idt's, is it just the base and offset to use? could someone plz post an example real mode idt
I have read about an ivt, how can i manipulate this to use int's as syscalls? Could i pick an int, say int 0x80, multiply it by four, and put my syscall func there? It seems a bit messy.
DISREGAURD THIS, I FIGURED OUT WHERE THE IVT WAS AND DIRECTLY MODIFIED IT
idt in rm
- mathematician
- Member
- Posts: 437
- Joined: Fri Dec 15, 2006 5:26 pm
- Location: Church Stretton Uk
memory in real mode is addressed by placing a sixteen bit paragraph number in a segment register and a sixteen bit offset in the ip (code seg), bp or sp (stack seg) or one of the si,di or bx registers (data seg). For example, if the cs register contained the paragraph address 0x57B4, and the ip register contained the offset 0x710D, then the absolute address as calculated by the processor would be 0x57B4 * 0x10 + 0x710D = 0x5EC4D. A real mode IDT contains 256 seg:offset pairs, each pair being the seg:offset address of the interrupt handler.
I have read about an ivt, how can i manipulate this to use int's as syscalls? Could i pick an int, say int 0x80, multiply it by four, and put my syscall func there? It seems a bit messy.
Point the int21h vector at its API entry point is what MS-DOS did, and what the real mode BIOS, with its various interrupt numbers, still does.
In the good ol' days, when the distinction between systems and application programming on the PC was distinctly blurred at the edges, anybody writing an app in real mode would be expected to know that kind of thing straight off, let alone somebody contemplating an OS.
I have read about an ivt, how can i manipulate this to use int's as syscalls? Could i pick an int, say int 0x80, multiply it by four, and put my syscall func there? It seems a bit messy.
Point the int21h vector at its API entry point is what MS-DOS did, and what the real mode BIOS, with its various interrupt numbers, still does.
In the good ol' days, when the distinction between systems and application programming on the PC was distinctly blurred at the edges, anybody writing an app in real mode would be expected to know that kind of thing straight off, let alone somebody contemplating an OS.
-
- Member
- Posts: 97
- Joined: Thu Mar 15, 2007 2:27 pm
I learned coding quite recently (i guess im part of what you might call the next generation of coders, who grew up using perl, python etc.), so osdev is my way of learning the innards to the x86 (especially real mode). When I started high school, DOS was a thing of the past, so real mode programming was obselete.mathematician wrote:memory in real mode is addressed by placing a
In the good ol' days, when the distinction between systems and application programming on the PC was distinctly blurred at the edges, anybody writing an app in real mode would be expected to know that kind of thing straight off, let alone somebody contemplating an OS.
Thanks for the help
-
- Member
- Posts: 97
- Joined: Thu Mar 15, 2007 2:27 pm
system timer int
I can't find any info on the system timer (interrupt), i would like to use it for multitasking. Could someone point me to some info?
- mathematician
- Member
- Posts: 437
- Joined: Fri Dec 15, 2006 5:26 pm
- Location: Church Stretton Uk
There are at least two system timers in the PC. In real mode, and probably in Windows, the most frequently referred to generates a type 8 interrupt 18.2 times a second. This comes from channel 0 of the 8253/8254 programmable interval timer. The latter is programmed by writing to ports 40h thru 43h. In particular you would be interested in 40h and 41h if you felt inclined to increase the 18.2Hz frequency (you can't decrease it). As ever with a hardware interrupts, you would need:
mov al,20h
out 20h,al
somewhere prior to the iret instruction.
mov al,20h
out 20h,al
somewhere prior to the iret instruction.