-
Notifications
You must be signed in to change notification settings - Fork 47
/
thread16.asm
94 lines (69 loc) · 1.04 KB
/
thread16.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
USE16
macro thread16header sts,sto
{
db 4096 dup (144) ; // fill NOPs
; Load IDT
CLI
mov di,DATA16
mov ds,di
lidt fword [ds:idt_RM_start]
; Stack
mov ax,sts
mov ss,ax
mov sp,sto
; A20
call FAR CODE16:EnableA20f
; Quick Enter 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
}
Thread16_1:
thread16header STACK16T1,stack16t1_end
; Start
mov [FromThread1],1
qunlock16 mut_1
cli
hlt
Thread16_2:
thread16header STACK16T2,stack16t2_end
mov [FromThread2],1
sti
mov dx,thrm1
mov ax,0900h
int 21h
cli
qunlock16 mut_1
cli
hlt
Thread16_3:
thread16header STACK16T3,stack16t3_end
mov [FromThread3],1
sti
mov dx,thrm2
mov ax,0900h
int 21h
cli
qunlock16 mut_1
cli
hlt
Thread16_4:
thread16header STACK16T4,stack16t4_end
mov [FromThread4],1
sti
mov dx,thrm3
mov ax,0900h
int 21h
cli
qunlock16 mut_1
cli
hlt