-
Notifications
You must be signed in to change notification settings - Fork 47
/
thread32.asm
56 lines (42 loc) · 667 Bytes
/
thread32.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
USE16
macro thread32header ofs,seg
{
USE16
; Remember CPU starts in real mode
db 4096 dup (144) ; // fill NOPs
; Stack
mov ax,STACK16T5
mov ss,ax
mov sp,stack16t5_end
; A20
call FAR CODE16:EnableA20f
; Unreal
call FAR CODE16:EnterUnreal
; Spurious, APIC
MOV EDI,[DS:LocalApic]
ADD EDI,0x0F0
MOV EDX,[FS:EDI]
OR EDX,0x1FF
push dword 0
pop fs
MOV [FS:EDI],EDX
MOV EDI,[DS:LocalApic]
ADD EDI,0x0B0
MOV dword [FS:EDI],0
; Protected
EnterProtected ofs,seg,0
}
Thread32_1:
thread32header Thread32_1a,code32_idx
cli
hlt
hlt
USE32
Thread32_1a:
mov ax,data16_idx
mov ds,ax
mov [FromThread5],1
qunlock32 mut_1
cli
hlt
USE32