Mercurial > lcfOS
comparison cos/kernel/asmcode.asm @ 18:6129643f5c34
Fixed interrupt issue, ds, es, ss, fs and gs were not initialized to 0
author | windel |
---|---|
date | Sun, 20 Nov 2011 20:35:51 +0100 |
parents | f3e3e0e9c4bc |
children | 66e9c332c845 |
comparison
equal
deleted
inserted
replaced
17:f3e3e0e9c4bc | 18:6129643f5c34 |
---|---|
2 ; from 20 - 31 are reserved vectors. | 2 ; from 20 - 31 are reserved vectors. |
3 ; below are the custom ones! | 3 ; below are the custom ones! |
4 | 4 |
5 section .text | 5 section .text |
6 align 4 | 6 align 4 |
7 | |
8 ; Port helpers: | |
9 ;global outb | |
10 ;outb: | |
11 ; mov eax, [esp + 8] | |
12 ; mov edx, [esp + 4] | |
13 ; out dx, al | |
14 ; ret | |
15 | |
16 ;global inb | |
17 ;inb: | |
18 ; xor eax, eax | |
19 ; mov edx, [esp + 4] | |
20 ; in al, dx | |
21 ; ret | |
22 | 7 |
23 global halt | 8 global halt |
24 halt: | 9 halt: |
25 cli | 10 cli |
26 hlt | 11 hlt |
61 ; Define macro with two arguments: | 46 ; Define macro with two arguments: |
62 %macro INTX 2 | 47 %macro INTX 2 |
63 global %1 | 48 global %1 |
64 %1: | 49 %1: |
65 ; Do some saving: | 50 ; Do some saving: |
51 cli | |
66 pushAll | 52 pushAll |
53 ;xchg bx,bx | |
54 | |
67 extern %2 | 55 extern %2 |
68 call %2 | 56 call %2 |
69 ; Do restoration | 57 ; Do restoration |
70 popAll | 58 popAll |
59 ;xchg bx, bx | |
60 sti | |
71 iretq | 61 iretq |
72 | 62 |
73 %endmacro | 63 %endmacro |
74 | 64 |
75 ; Exception handlers: | 65 ; Exception handlers: |