mirror of
https://github.com/tailix/kernel.git
synced 2024-11-20 11:16:10 -05:00
Fix errors
This commit is contained in:
parent
73ea1e22d5
commit
adcb66761b
4 changed files with 10 additions and 9 deletions
|
@ -20,10 +20,10 @@ interrupt_%2:
|
|||
%macro INTERRUPT_COMMON 1
|
||||
[EXTERN %1_handler]
|
||||
%1_wrapper:
|
||||
pusha ; Pushes edi,esi,ebp,esp,ebx,edx,ecx,eax
|
||||
pushad
|
||||
|
||||
mov ax, ds ; Lower 16-bits of eax = ds.
|
||||
push eax ; save the data segment descriptor
|
||||
push dword eax ; save the data segment descriptor
|
||||
|
||||
mov ax, GDT_KERNEL_DS_SELECTOR
|
||||
mov ds, ax
|
||||
|
@ -33,13 +33,14 @@ interrupt_%2:
|
|||
|
||||
call %1_handler
|
||||
|
||||
pop eax ; reload the original data segment descriptor
|
||||
pop dword eax ; reload the original data segment descriptor
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
mov fs, ax
|
||||
mov gs, ax
|
||||
|
||||
popa ; Pops edi,esi,ebp...
|
||||
popad
|
||||
|
||||
add esp, 8 ; Cleans up the pushed error code and pushed ISR number
|
||||
sti
|
||||
iret ; pops 5 things at once: CS, EIP, EFLAGS, SS, and ESP
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
struct IsrRegisters {
|
||||
unsigned int ds; // Data segment selector
|
||||
unsigned int edi, esi, ebp, esp, ebx, edx, ecx, eax; // Pushed by pusha.
|
||||
unsigned int int_no, err_code; // Interrupt number and error code (if applicable)
|
||||
unsigned int eip, cs, eflags, useresp, ss; // Pushed by the processor automatically.
|
||||
unsigned char int_no, err_code; // Interrupt number and error code (if applicable)
|
||||
unsigned int ip, cs, flags, sp, ss; // Pushed by the processor automatically.
|
||||
};
|
||||
|
||||
// Protected mode exteptions
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
void syscall_handler(struct IsrRegisters regs)
|
||||
{
|
||||
const unsigned int id = regs.eax;
|
||||
const unsigned int id = regs.eax & 0xFFFF;
|
||||
|
||||
kprintf("syscall %u\n", id);
|
||||
}
|
||||
|
|
|
@ -2,10 +2,10 @@ main:
|
|||
mov eax, 0
|
||||
int 0x80
|
||||
|
||||
mov eax, 3
|
||||
mov eax, 512
|
||||
int 0x80
|
||||
|
||||
mov eax, 134
|
||||
mov eax, 35000
|
||||
int 0x80
|
||||
|
||||
ret
|
||||
|
|
Loading…
Reference in a new issue