projects
/
3sys
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
selectors, descriptors, more interrupt init
[3sys]
/
sys1
/
kern
/
src
/
mem.asm
1
bits 32
2
section .text
3
4
global set_gdt
5
set_gdt:
6
mov eax, [esp + 4]
7
mov [gdtbase], eax
8
mov ax, [esp + 8]
9
mov [gdtlim], ax
10
lgdt [gdtlim]
11
ret
12
13
global setup_selectors
14
setup_selectors:
15
; set data selectors directly
16
mov ax, [esp + 8]
17
mov ss, ax
18
mov es, ax
19
mov ds, ax
20
mov gs, ax
21
mov fs, ax
22
; set cs with a long jump
23
mov ax, [esp + 4]
24
mov [jseg], ax
25
mov dword [joffs], .setcs
26
jmp far [joffs]
27
.setcs: ret
28
29
30
align 4
31
joffs dd 0
32
jseg dw 0
33
gdtlim dw 0
34
gdtbase dd 0
35
36
; vi:ft=nasm: