Rev 3592 | Rev 3627 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3592 | Rev 3606 | ||
---|---|---|---|
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
2 | ;; ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; ;; |
5 | ;; ;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
7 | 7 | ||
8 | $Revision: 3592 $ |
8 | $Revision: 3606 $ |
9 | 9 | ||
10 | 10 | ||
11 | dpl0 equ 10010000b ; data read dpl0 |
11 | dpl0 equ 10010000b ; data read dpl0 |
12 | drw0 equ 10010010b ; data read/write dpl0 |
12 | drw0 equ 10010010b ; data read/write dpl0 |
13 | drw3 equ 11110010b ; data read/write dpl3 |
13 | drw3 equ 11110010b ; data read/write dpl3 |
14 | cpl0 equ 10011010b ; code read dpl0 |
14 | cpl0 equ 10011010b ; code read dpl0 |
15 | cpl3 equ 11111010b ; code read dpl3 |
15 | cpl3 equ 11111010b ; code read dpl3 |
16 | 16 | ||
17 | D32 equ 01000000b ; 32bit segment |
17 | D32 equ 01000000b ; 32bit segment |
18 | G32 equ 10000000b ; page gran |
18 | G32 equ 10000000b ; page gran |
19 | 19 | ||
20 | 20 | ||
21 | ;;;;;;;;;;;;cpu_caps flags;;;;;;;;;;;;;;;; |
21 | ;;;;;;;;;;;;cpu_caps flags;;;;;;;;;;;;;;;; |
22 | 22 | ||
23 | CPU_386 equ 3 |
23 | CPU_386 equ 3 |
24 | CPU_486 equ 4 |
24 | CPU_486 equ 4 |
25 | CPU_PENTIUM equ 5 |
25 | CPU_PENTIUM equ 5 |
26 | CPU_P6 equ 6 |
26 | CPU_P6 equ 6 |
27 | CPU_PENTIUM4 equ 0x0F |
27 | CPU_PENTIUM4 equ 0x0F |
28 | 28 | ||
29 | CAPS_FPU equ 00 ;on-chip x87 floating point unit |
29 | CAPS_FPU equ 00 ;on-chip x87 floating point unit |
30 | CAPS_VME equ 01 ;virtual-mode enhancements |
30 | CAPS_VME equ 01 ;virtual-mode enhancements |
31 | CAPS_DE equ 02 ;debugging extensions |
31 | CAPS_DE equ 02 ;debugging extensions |
32 | CAPS_PSE equ 03 ;page-size extensions |
32 | CAPS_PSE equ 03 ;page-size extensions |
33 | CAPS_TSC equ 04 ;time stamp counter |
33 | CAPS_TSC equ 04 ;time stamp counter |
34 | CAPS_MSR equ 05 ;model-specific registers |
34 | CAPS_MSR equ 05 ;model-specific registers |
35 | CAPS_PAE equ 06 ;physical-address extensions |
35 | CAPS_PAE equ 06 ;physical-address extensions |
36 | CAPS_MCE equ 07 ;machine check exception |
36 | CAPS_MCE equ 07 ;machine check exception |
37 | CAPS_CX8 equ 08 ;CMPXCHG8B instruction |
37 | CAPS_CX8 equ 08 ;CMPXCHG8B instruction |
38 | CAPS_APIC equ 09 ;on-chip advanced programmable |
38 | CAPS_APIC equ 09 ;on-chip advanced programmable |
39 | ; interrupt controller |
39 | ; interrupt controller |
40 | ; 10 ;unused |
40 | ; 10 ;unused |
41 | CAPS_SEP equ 11 ;SYSENTER and SYSEXIT instructions |
41 | CAPS_SEP equ 11 ;SYSENTER and SYSEXIT instructions |
42 | CAPS_MTRR equ 12 ;memory-type range registers |
42 | CAPS_MTRR equ 12 ;memory-type range registers |
43 | CAPS_PGE equ 13 ;page global extension |
43 | CAPS_PGE equ 13 ;page global extension |
44 | CAPS_MCA equ 14 ;machine check architecture |
44 | CAPS_MCA equ 14 ;machine check architecture |
45 | CAPS_CMOV equ 15 ;conditional move instructions |
45 | CAPS_CMOV equ 15 ;conditional move instructions |
46 | CAPS_PAT equ 16 ;page attribute table |
46 | CAPS_PAT equ 16 ;page attribute table |
47 | 47 | ||
48 | CAPS_PSE36 equ 17 ;page-size extensions |
48 | CAPS_PSE36 equ 17 ;page-size extensions |
49 | CAPS_PSN equ 18 ;processor serial number |
49 | CAPS_PSN equ 18 ;processor serial number |
50 | CAPS_CLFLUSH equ 19 ;CLFUSH instruction |
50 | CAPS_CLFLUSH equ 19 ;CLFUSH instruction |
51 | 51 | ||
52 | CAPS_DS equ 21 ;debug store |
52 | CAPS_DS equ 21 ;debug store |
53 | CAPS_ACPI equ 22 ;thermal monitor and software |
53 | CAPS_ACPI equ 22 ;thermal monitor and software |
54 | ;controlled clock supported |
54 | ;controlled clock supported |
55 | CAPS_MMX equ 23 ;MMX instructions |
55 | CAPS_MMX equ 23 ;MMX instructions |
56 | CAPS_FXSR equ 24 ;FXSAVE and FXRSTOR instructions |
56 | CAPS_FXSR equ 24 ;FXSAVE and FXRSTOR instructions |
57 | CAPS_SSE equ 25 ;SSE instructions |
57 | CAPS_SSE equ 25 ;SSE instructions |
58 | CAPS_SSE2 equ 26 ;SSE2 instructions |
58 | CAPS_SSE2 equ 26 ;SSE2 instructions |
59 | CAPS_SS equ 27 ;self-snoop |
59 | CAPS_SS equ 27 ;self-snoop |
60 | CAPS_HTT equ 28 ;hyper-threading technology |
60 | CAPS_HTT equ 28 ;hyper-threading technology |
61 | CAPS_TM equ 29 ;thermal monitor supported |
61 | CAPS_TM equ 29 ;thermal monitor supported |
62 | CAPS_IA64 equ 30 ;IA64 capabilities |
62 | CAPS_IA64 equ 30 ;IA64 capabilities |
63 | CAPS_PBE equ 31 ;pending break enable |
63 | CAPS_PBE equ 31 ;pending break enable |
64 | 64 | ||
65 | ;ecx |
65 | ;ecx |
66 | CAPS_SSE3 equ 32 ;SSE3 instructions |
66 | CAPS_SSE3 equ 32 ;SSE3 instructions |
67 | ; 33 |
67 | ; 33 |
68 | ; 34 |
68 | ; 34 |
69 | CAPS_MONITOR equ 35 ;MONITOR/MWAIT instructions |
69 | CAPS_MONITOR equ 35 ;MONITOR/MWAIT instructions |
70 | CAPS_DS_CPL equ 36 ; |
70 | CAPS_DS_CPL equ 36 ; |
71 | CAPS_VMX equ 37 ;virtual mode extensions |
71 | CAPS_VMX equ 37 ;virtual mode extensions |
72 | ; 38 ; |
72 | ; 38 ; |
73 | CAPS_EST equ 39 ;enhansed speed step |
73 | CAPS_EST equ 39 ;enhansed speed step |
74 | CAPS_TM2 equ 40 ;thermal monitor2 supported |
74 | CAPS_TM2 equ 40 ;thermal monitor2 supported |
75 | ; 41 |
75 | ; 41 |
76 | CAPS_CID equ 42 ; |
76 | CAPS_CID equ 42 ; |
77 | ; 43 |
77 | ; 43 |
78 | ; 44 |
78 | ; 44 |
79 | CAPS_CX16 equ 45 ;CMPXCHG16B instruction |
79 | CAPS_CX16 equ 45 ;CMPXCHG16B instruction |
80 | CAPS_xTPR equ 46 ; |
80 | CAPS_xTPR equ 46 ; |
81 | ; |
81 | ; |
82 | ;reserved |
82 | ;reserved |
83 | ; |
83 | ; |
84 | ;ext edx /ecx |
84 | ;ext edx /ecx |
85 | CAPS_SYSCAL equ 64 ; |
85 | CAPS_SYSCAL equ 64 ; |
86 | CAPS_XD equ 65 ;execution disable |
86 | CAPS_XD equ 65 ;execution disable |
87 | CAPS_FFXSR equ 66 ; |
87 | CAPS_FFXSR equ 66 ; |
88 | CAPS_RDTSCP equ 67 ; |
88 | CAPS_RDTSCP equ 67 ; |
89 | CAPS_X64 equ 68 ; |
89 | CAPS_X64 equ 68 ; |
90 | CAPS_3DNOW equ 69 ; |
90 | CAPS_3DNOW equ 69 ; |
91 | CAPS_3DNOWEXT equ 70 ; |
91 | CAPS_3DNOWEXT equ 70 ; |
92 | CAPS_LAHF equ 71 ; |
92 | CAPS_LAHF equ 71 ; |
93 | CAPS_CMP_LEG equ 72 ; |
93 | CAPS_CMP_LEG equ 72 ; |
94 | CAPS_SVM equ 73 ;secure virual machine |
94 | CAPS_SVM equ 73 ;secure virual machine |
95 | CAPS_ALTMOVCR8 equ 74 ; |
95 | CAPS_ALTMOVCR8 equ 74 ; |
96 | 96 | ||
97 | ; CPU MSR names |
97 | ; CPU MSR names |
98 | MSR_SYSENTER_CS equ 0x174 |
98 | MSR_SYSENTER_CS equ 0x174 |
99 | MSR_SYSENTER_ESP equ 0x175 |
99 | MSR_SYSENTER_ESP equ 0x175 |
100 | MSR_SYSENTER_EIP equ 0x176 |
100 | MSR_SYSENTER_EIP equ 0x176 |
101 | MSR_AMD_EFER equ 0xC0000080 ; Extended Feature Enable Register |
101 | MSR_AMD_EFER equ 0xC0000080 ; Extended Feature Enable Register |
102 | MSR_AMD_STAR equ 0xC0000081 ; SYSCALL/SYSRET Target Address Register |
102 | MSR_AMD_STAR equ 0xC0000081 ; SYSCALL/SYSRET Target Address Register |
103 | 103 | ||
104 | CR0_PE equ 0x00000001 ;protected mode |
104 | CR0_PE equ 0x00000001 ;protected mode |
105 | CR0_MP equ 0x00000002 ;monitor fpu |
105 | CR0_MP equ 0x00000002 ;monitor fpu |
106 | CR0_EM equ 0x00000004 ;fpu emulation |
106 | CR0_EM equ 0x00000004 ;fpu emulation |
107 | CR0_TS equ 0x00000008 ;task switch |
107 | CR0_TS equ 0x00000008 ;task switch |
108 | CR0_ET equ 0x00000010 ;extension type hardcoded to 1 |
108 | CR0_ET equ 0x00000010 ;extension type hardcoded to 1 |
109 | CR0_NE equ 0x00000020 ;numeric error |
109 | CR0_NE equ 0x00000020 ;numeric error |
110 | CR0_WP equ 0x00010000 ;write protect |
110 | CR0_WP equ 0x00010000 ;write protect |
111 | CR0_AM equ 0x00040000 ;alignment check |
111 | CR0_AM equ 0x00040000 ;alignment check |
112 | CR0_NW equ 0x20000000 ;not write-through |
112 | CR0_NW equ 0x20000000 ;not write-through |
113 | CR0_CD equ 0x40000000 ;cache disable |
113 | CR0_CD equ 0x40000000 ;cache disable |
114 | CR0_PG equ 0x80000000 ;paging |
114 | CR0_PG equ 0x80000000 ;paging |
115 | 115 | ||
116 | 116 | ||
117 | CR4_VME equ 0x0001 |
117 | CR4_VME equ 0x0001 |
118 | CR4_PVI equ 0x0002 |
118 | CR4_PVI equ 0x0002 |
119 | CR4_TSD equ 0x0004 |
119 | CR4_TSD equ 0x0004 |
120 | CR4_DE equ 0x0008 |
120 | CR4_DE equ 0x0008 |
121 | CR4_PSE equ 0x0010 |
121 | CR4_PSE equ 0x0010 |
122 | CR4_PAE equ 0x0020 |
122 | CR4_PAE equ 0x0020 |
123 | CR4_MCE equ 0x0040 |
123 | CR4_MCE equ 0x0040 |
124 | CR4_PGE equ 0x0080 |
124 | CR4_PGE equ 0x0080 |
125 | CR4_PCE equ 0x0100 |
125 | CR4_PCE equ 0x0100 |
126 | CR4_OSFXSR equ 0x0200 |
126 | CR4_OSFXSR equ 0x0200 |
127 | CR4_OSXMMEXPT equ 0x0400 |
127 | CR4_OSXMMEXPT equ 0x0400 |
128 | 128 | ||
129 | SSE_IE equ 0x0001 |
129 | SSE_IE equ 0x0001 |
130 | SSE_DE equ 0x0002 |
130 | SSE_DE equ 0x0002 |
131 | SSE_ZE equ 0x0004 |
131 | SSE_ZE equ 0x0004 |
132 | SSE_OE equ 0x0008 |
132 | SSE_OE equ 0x0008 |
133 | SSE_UE equ 0x0010 |
133 | SSE_UE equ 0x0010 |
134 | SSE_PE equ 0x0020 |
134 | SSE_PE equ 0x0020 |
135 | SSE_DAZ equ 0x0040 |
135 | SSE_DAZ equ 0x0040 |
136 | SSE_IM equ 0x0080 |
136 | SSE_IM equ 0x0080 |
137 | SSE_DM equ 0x0100 |
137 | SSE_DM equ 0x0100 |
138 | SSE_ZM equ 0x0200 |
138 | SSE_ZM equ 0x0200 |
139 | SSE_OM equ 0x0400 |
139 | SSE_OM equ 0x0400 |
140 | SSE_UM equ 0x0800 |
140 | SSE_UM equ 0x0800 |
141 | SSE_PM equ 0x1000 |
141 | SSE_PM equ 0x1000 |
142 | SSE_FZ equ 0x8000 |
142 | SSE_FZ equ 0x8000 |
143 | 143 | ||
144 | SSE_INIT equ (SSE_IM+SSE_DM+SSE_ZM+SSE_OM+SSE_UM+SSE_PM) |
144 | SSE_INIT equ (SSE_IM+SSE_DM+SSE_ZM+SSE_OM+SSE_UM+SSE_PM) |
145 | 145 | ||
146 | IRQ_PIC equ 0 |
146 | IRQ_PIC equ 0 |
147 | IRQ_APIC equ 1 |
147 | IRQ_APIC equ 1 |
148 | 148 | ||
149 | struct TSS |
149 | struct TSS |
150 | _back rw 2 |
150 | _back rw 2 |
151 | _esp0 rd 1 |
151 | _esp0 rd 1 |
152 | _ss0 rw 2 |
152 | _ss0 rw 2 |
153 | _esp1 rd 1 |
153 | _esp1 rd 1 |
154 | _ss1 rw 2 |
154 | _ss1 rw 2 |
155 | _esp2 rd 1 |
155 | _esp2 rd 1 |
156 | _ss2 rw 2 |
156 | _ss2 rw 2 |
157 | _cr3 rd 1 |
157 | _cr3 rd 1 |
158 | _eip rd 1 |
158 | _eip rd 1 |
159 | _eflags rd 1 |
159 | _eflags rd 1 |
160 | _eax rd 1 |
160 | _eax rd 1 |
161 | _ecx rd 1 |
161 | _ecx rd 1 |
162 | _edx rd 1 |
162 | _edx rd 1 |
163 | _ebx rd 1 |
163 | _ebx rd 1 |
164 | _esp rd 1 |
164 | _esp rd 1 |
165 | _ebp rd 1 |
165 | _ebp rd 1 |
166 | _esi rd 1 |
166 | _esi rd 1 |
167 | _edi rd 1 |
167 | _edi rd 1 |
168 | _es rw 2 |
168 | _es rw 2 |
169 | _cs rw 2 |
169 | _cs rw 2 |
170 | _ss rw 2 |
170 | _ss rw 2 |
171 | _ds rw 2 |
171 | _ds rw 2 |
172 | _fs rw 2 |
172 | _fs rw 2 |
173 | _gs rw 2 |
173 | _gs rw 2 |
174 | _ldt rw 2 |
174 | _ldt rw 2 |
175 | _trap rw 1 |
175 | _trap rw 1 |
176 | _io rw 1 |
176 | _io rw 1 |
177 | rb 24 |
177 | rb 24 |
178 | _io_map_0 rb 4096 |
178 | _io_map_0 rb 4096 |
179 | _io_map_1 rb 4096 |
179 | _io_map_1 rb 4096 |
180 | ends |
180 | ends |
181 | 181 | ||
182 | OS_BASE equ 0x80000000 |
182 | OS_BASE equ 0x80000000 |
183 | 183 | ||
184 | window_data equ (OS_BASE+0x0001000) |
184 | window_data equ (OS_BASE+0x0001000) |
185 | 185 | ||
186 | CURRENT_TASK equ (OS_BASE+0x0003000) |
186 | CURRENT_TASK equ (OS_BASE+0x0003000) |
187 | TASK_COUNT equ (OS_BASE+0x0003004) |
187 | TASK_COUNT equ (OS_BASE+0x0003004) |
188 | TASK_BASE equ (OS_BASE+0x0003010) |
188 | TASK_BASE equ (OS_BASE+0x0003010) |
189 | TASK_DATA equ (OS_BASE+0x0003020) |
189 | TASK_DATA equ (OS_BASE+0x0003020) |
190 | TASK_EVENT equ (OS_BASE+0x0003020) |
190 | TASK_EVENT equ (OS_BASE+0x0003020) |
191 | 191 | ||
192 | mouseunder equ (OS_BASE+0x0006900) |
192 | mouseunder equ (OS_BASE+0x0006900) |
193 | CDDataBuf equ (OS_BASE+0x0007000) |
193 | CDDataBuf equ (OS_BASE+0x0007000) |
194 | FLOPPY_BUFF equ (OS_BASE+0x0008000) |
194 | FLOPPY_BUFF equ (OS_BASE+0x0008000) |
195 | ACTIVE_PROC_STACK equ (OS_BASE+0x000A400) ;unused |
195 | ACTIVE_PROC_STACK equ (OS_BASE+0x000A400) ;unused |
196 | idts equ (OS_BASE+0x000B100) |
196 | idts equ (OS_BASE+0x000B100) |
197 | WIN_STACK equ (OS_BASE+0x000C000) |
197 | WIN_STACK equ (OS_BASE+0x000C000) |
198 | WIN_POS equ (OS_BASE+0x000C400) |
198 | WIN_POS equ (OS_BASE+0x000C400) |
199 | FDD_BUFF equ (OS_BASE+0x000D000) |
199 | FDD_BUFF equ (OS_BASE+0x000D000) |
200 | 200 | ||
201 | PUTPIXEL equ (OS_BASE+0x000E020) |
201 | PUTPIXEL equ (OS_BASE+0x000E020) |
202 | GETPIXEL equ (OS_BASE+0x000E024) |
202 | GETPIXEL equ (OS_BASE+0x000E024) |
203 | 203 | ||
204 | ;unused ? only one reference |
204 | ;unused ? only one reference |
205 | BANK_SWITCH equ (OS_BASE+0x000E030) |
205 | BANK_SWITCH equ (OS_BASE+0x000E030) |
206 | 206 | ||
207 | ;unused ? store mousepointer |
207 | ;unused ? store mousepointer |
208 | MOUSE_PICTURE equ (OS_BASE+0x000F200) |
208 | MOUSE_PICTURE equ (OS_BASE+0x000F200) |
209 | 209 | ||
210 | ;MOUSE_VISIBLE equ (OS_BASE+0x000F204) |
210 | ;MOUSE_VISIBLE equ (OS_BASE+0x000F204) |
211 | WIN_TEMP_XY equ (OS_BASE+0x000F300) |
211 | WIN_TEMP_XY equ (OS_BASE+0x000F300) |
212 | KEY_COUNT equ (OS_BASE+0x000F400) |
212 | KEY_COUNT equ (OS_BASE+0x000F400) |
213 | KEY_BUFF equ (OS_BASE+0x000F401) |
213 | KEY_BUFF equ (OS_BASE+0x000F401) |
214 | 214 | ||
215 | BTN_COUNT equ (OS_BASE+0x000F500) |
215 | BTN_COUNT equ (OS_BASE+0x000F500) |
216 | BTN_BUFF equ (OS_BASE+0x000F501) |
216 | BTN_BUFF equ (OS_BASE+0x000F501) |
217 | 217 | ||
218 | 218 | ||
219 | MOUSE_SCROLL_H equ (OS_BASE+0x000FB08) |
219 | MOUSE_SCROLL_H equ (OS_BASE+0x000FB08) |
220 | MOUSE_X equ (OS_BASE+0x000FB0A) |
220 | MOUSE_X equ (OS_BASE+0x000FB0A) |
221 | MOUSE_Y equ (OS_BASE+0x000FB0C) |
221 | MOUSE_Y equ (OS_BASE+0x000FB0C) |
222 | MOUSE_SCROLL_V equ (OS_BASE+0x000FB0E) |
222 | MOUSE_SCROLL_V equ (OS_BASE+0x000FB0E) |
223 | 223 | ||
224 | MOUSE_COLOR_MEM equ (OS_BASE+0x000FB10) |
224 | MOUSE_COLOR_MEM equ (OS_BASE+0x000FB10) |
225 | COLOR_TEMP equ (OS_BASE+0x000FB30) |
225 | COLOR_TEMP equ (OS_BASE+0x000FB30) |
226 | BTN_DOWN equ (OS_BASE+0x000FB40) |
226 | BTN_DOWN equ (OS_BASE+0x000FB40) |
227 | X_UNDER equ (OS_BASE+0x000FB4A) |
227 | X_UNDER equ (OS_BASE+0x000FB4A) |
228 | Y_UNDER equ (OS_BASE+0x000FB4C) |
228 | Y_UNDER equ (OS_BASE+0x000FB4C) |
229 | 229 | ||
230 | ;unused ? only one reference |
230 | ;unused ? only one reference |
231 | MOUSE_BUFF_COUNT equ (OS_BASE+0x000FCFF) |
231 | MOUSE_BUFF_COUNT equ (OS_BASE+0x000FCFF) |
232 | - | ||
233 | Screen_Max_X equ (OS_BASE+0x000FE00) |
- | |
234 | Screen_Max_Y equ (OS_BASE+0x000FE04) |
- | |
235 | BytesPerScanLine equ (OS_BASE+0x000FE08) |
- | |
236 | SCR_MODE equ (OS_BASE+0x000FE0C) |
232 | |
237 | 233 | ||
238 | LFBAddress equ (OS_BASE+0x000FE80) |
234 | LFBAddress equ (OS_BASE+0x000FE80) |
239 | BTN_ADDR equ (OS_BASE+0x000FE88) |
235 | BTN_ADDR equ (OS_BASE+0x000FE88) |
240 | MEM_AMOUNT equ (OS_BASE+0x000FE8C) |
236 | MEM_AMOUNT equ (OS_BASE+0x000FE8C) |
241 | 237 | ||
242 | SYS_SHUTDOWN equ (OS_BASE+0x000FF00) |
238 | SYS_SHUTDOWN equ (OS_BASE+0x000FF00) |
243 | TASK_ACTIVATE equ (OS_BASE+0x000FF01) |
239 | TASK_ACTIVATE equ (OS_BASE+0x000FF01) |
244 | 240 | ||
245 | REDRAW_BACKGROUND equ (OS_BASE+0x000FFF0) |
241 | REDRAW_BACKGROUND equ (OS_BASE+0x000FFF0) |
246 | 242 | ||
247 | BANK_RW equ (OS_BASE+0x000FFF2) |
243 | BANK_RW equ (OS_BASE+0x000FFF2) |
248 | 244 | ||
249 | TMP_STACK_TOP equ 0x006CC00 |
245 | TMP_STACK_TOP equ 0x006CC00 |
250 | 246 | ||
251 | sys_pgdir equ (OS_BASE+0x006F000) |
247 | sys_pgdir equ (OS_BASE+0x006F000) |
252 | 248 | ||
253 | DRIVE_DATA equ (OS_BASE+0x0070000) |
249 | DRIVE_DATA equ (OS_BASE+0x0070000) |
254 | 250 | ||
255 | SLOT_BASE equ (OS_BASE+0x0080000) |
251 | SLOT_BASE equ (OS_BASE+0x0080000) |
256 | 252 | ||
257 | ;unused |
253 | ;unused |
258 | TMP_BUFF equ (OS_BASE+0x0090000) |
254 | TMP_BUFF equ (OS_BASE+0x0090000) |
259 | 255 | ||
260 | VGABasePtr equ (OS_BASE+0x00A0000) |
256 | VGABasePtr equ (OS_BASE+0x00A0000) |
261 | 257 | ||
262 | RAMDISK equ (OS_BASE+0x0100000) |
258 | RAMDISK equ (OS_BASE+0x0100000) |
263 | RAMDISK_FAT equ (OS_BASE+0x0280000) |
259 | RAMDISK_FAT equ (OS_BASE+0x0280000) |
264 | FLOPPY_FAT equ (OS_BASE+0x0282000) |
260 | FLOPPY_FAT equ (OS_BASE+0x0282000) |
265 | 261 | ||
266 | CLEAN_ZONE equ 0x284000 |
262 | CLEAN_ZONE equ 0x284000 |
267 | IDE_DMA equ 0x284000 |
263 | IDE_DMA equ 0x284000 |
268 | 264 | ||
269 | BgrAuxTable equ (OS_BASE+0x0298000) |
265 | BgrAuxTable equ (OS_BASE+0x0298000) |
270 | ; unused? |
266 | ; unused? |
271 | SB16Buffer equ (OS_BASE+0x02A0000) |
267 | SB16Buffer equ (OS_BASE+0x02A0000) |
272 | SB16_Status equ (OS_BASE+0x02B0000) |
268 | SB16_Status equ (OS_BASE+0x02B0000) |
273 | 269 | ||
274 | BUTTON_INFO equ (OS_BASE+0x02B3FEE) |
270 | BUTTON_INFO equ (OS_BASE+0x02B3FEE) |
275 | 271 | ||
276 | BPSLine_calc_area equ (OS_BASE+0x02C4000) |
272 | BPSLine_calc_area equ (OS_BASE+0x02C4000) |
277 | d_width_calc_area equ (OS_BASE+0x02CA000) |
273 | d_width_calc_area equ (OS_BASE+0x02CA000) |
278 | 274 | ||
279 | RESERVED_PORTS equ (OS_BASE+0x02D0000) |
275 | RESERVED_PORTS equ (OS_BASE+0x02D0000) |
280 | BOOT_VAR equ (OS_BASE+0x02E0000) |
276 | BOOT_VAR equ (OS_BASE+0x02E0000) |
281 | 277 | ||
282 | draw_data equ (OS_BASE+0x0320000) |
278 | draw_data equ (OS_BASE+0x0320000) |
283 | - | ||
284 | BgrDrawMode equ (OS_BASE+0x0323FF4) |
- | |
285 | BgrDataWidth equ (OS_BASE+0x0323FF8) |
- | |
286 | BgrDataHeight equ (OS_BASE+0x0323FFC) |
- | |
287 | 279 | ||
288 | sys_pgmap equ (OS_BASE+0x0324000) |
280 | sys_pgmap equ (OS_BASE+0x0324000) |
289 | 281 | ||
290 | UPPER_KERNEL_PAGES equ (OS_BASE+0x0400000) |
282 | UPPER_KERNEL_PAGES equ (OS_BASE+0x0400000) |
291 | 283 | ||
292 | virtual at (OS_BASE+0x05FFF80) |
284 | virtual at (OS_BASE+0x05FFF80) |
293 | tss TSS |
285 | tss TSS |
294 | end virtual |
286 | end virtual |
295 | 287 | ||
296 | HEAP_BASE equ (OS_BASE+0x0800000) |
288 | HEAP_BASE equ (OS_BASE+0x0800000) |
297 | HEAP_MIN_SIZE equ 0x01000000 |
289 | HEAP_MIN_SIZE equ 0x01000000 |
298 | 290 | ||
299 | page_tabs equ 0xFDC00000 |
291 | page_tabs equ 0xFDC00000 |
300 | app_page_tabs equ 0xFDC00000 |
292 | app_page_tabs equ 0xFDC00000 |
301 | kernel_tabs equ (page_tabs+ (OS_BASE shr 10)) ;0xFDE00000 |
293 | kernel_tabs equ (page_tabs+ (OS_BASE shr 10)) ;0xFDE00000 |
302 | master_tab equ (page_tabs+ (page_tabs shr 10)) ;0xFDFF70000 |
294 | master_tab equ (page_tabs+ (page_tabs shr 10)) ;0xFDFF70000 |
303 | 295 | ||
304 | LFB_BASE equ 0xFE000000 |
296 | LFB_BASE equ 0xFE000000 |
305 | 297 | ||
306 | 298 | ||
307 | new_app_base equ 0; |
299 | new_app_base equ 0; |
308 | 300 | ||
309 | twdw equ 0x2000 ;(CURRENT_TASK-window_data) |
301 | twdw equ 0x2000 ;(CURRENT_TASK-window_data) |
310 | 302 | ||
311 | std_application_base_address equ new_app_base |
303 | std_application_base_address equ new_app_base |
312 | RING0_STACK_SIZE equ (0x2000 - 512) ;512 байт для контекста FPU |
304 | RING0_STACK_SIZE equ (0x2000 - 512) ;512 байт для контекста FPU |
313 | 305 | ||
314 | REG_SS equ (RING0_STACK_SIZE-4) |
306 | REG_SS equ (RING0_STACK_SIZE-4) |
315 | REG_APP_ESP equ (RING0_STACK_SIZE-8) |
307 | REG_APP_ESP equ (RING0_STACK_SIZE-8) |
316 | REG_EFLAGS equ (RING0_STACK_SIZE-12) |
308 | REG_EFLAGS equ (RING0_STACK_SIZE-12) |
317 | REG_CS equ (RING0_STACK_SIZE-16) |
309 | REG_CS equ (RING0_STACK_SIZE-16) |
318 | REG_EIP equ (RING0_STACK_SIZE-20) |
310 | REG_EIP equ (RING0_STACK_SIZE-20) |
319 | REG_EAX equ (RING0_STACK_SIZE-24) |
311 | REG_EAX equ (RING0_STACK_SIZE-24) |
320 | REG_ECX equ (RING0_STACK_SIZE-28) |
312 | REG_ECX equ (RING0_STACK_SIZE-28) |
321 | REG_EDX equ (RING0_STACK_SIZE-32) |
313 | REG_EDX equ (RING0_STACK_SIZE-32) |
322 | REG_EBX equ (RING0_STACK_SIZE-36) |
314 | REG_EBX equ (RING0_STACK_SIZE-36) |
323 | REG_ESP equ (RING0_STACK_SIZE-40) ;RING0_STACK_SIZE-20 |
315 | REG_ESP equ (RING0_STACK_SIZE-40) ;RING0_STACK_SIZE-20 |
324 | REG_EBP equ (RING0_STACK_SIZE-44) |
316 | REG_EBP equ (RING0_STACK_SIZE-44) |
325 | REG_ESI equ (RING0_STACK_SIZE-48) |
317 | REG_ESI equ (RING0_STACK_SIZE-48) |
326 | REG_EDI equ (RING0_STACK_SIZE-52) |
318 | REG_EDI equ (RING0_STACK_SIZE-52) |
327 | REG_RET equ (RING0_STACK_SIZE-56) ;irq0.return |
319 | REG_RET equ (RING0_STACK_SIZE-56) ;irq0.return |
328 | 320 | ||
329 | 321 | ||
330 | PG_UNMAP equ 0x000 |
322 | PG_UNMAP equ 0x000 |
331 | PG_MAP equ 0x001 |
323 | PG_MAP equ 0x001 |
332 | PG_WRITE equ 0x002 |
324 | PG_WRITE equ 0x002 |
333 | PG_SW equ 0x003 |
325 | PG_SW equ 0x003 |
334 | PG_USER equ 0x005 |
326 | PG_USER equ 0x005 |
335 | PG_UW equ 0x007 |
327 | PG_UW equ 0x007 |
336 | PG_NOCACHE equ 0x018 |
328 | PG_NOCACHE equ 0x018 |
337 | PG_LARGE equ 0x080 |
329 | PG_LARGE equ 0x080 |
338 | PG_GLOBAL equ 0x100 |
330 | PG_GLOBAL equ 0x100 |
339 | 331 | ||
340 | PG_SHARED equ 0x200 |
332 | PG_SHARED equ 0x200 |
341 | 333 | ||
342 | ;;;;;;;;;;;boot time variables |
334 | ;;;;;;;;;;;boot time variables |
343 | 335 | ||
344 | BOOT_BPP equ 0x9000 ;byte bits per pixel |
336 | BOOT_BPP equ 0x9000 ;byte bits per pixel |
345 | BOOT_PITCH equ 0x9001 ;word scanline length |
337 | BOOT_PITCH equ 0x9001 ;word scanline length |
346 | BOOT_VESA_MODE equ 0x9008 ;word vesa video mode |
338 | BOOT_VESA_MODE equ 0x9008 ;word vesa video mode |
347 | BOOT_X_RES equ 0x900A ;word X res |
339 | BOOT_X_RES equ 0x900A ;word X res |
348 | BOOT_Y_RES equ 0x900C ;word Y res |
340 | BOOT_Y_RES equ 0x900C ;word Y res |
349 | BOOT_BANK_SW equ 0x9014 ;dword Vesa 1.2 pm bank switch |
341 | BOOT_BANK_SW equ 0x9014 ;dword Vesa 1.2 pm bank switch |
350 | BOOT_LFB equ 0x9018 ;dword Vesa 2.0 LFB address |
342 | BOOT_LFB equ 0x9018 ;dword Vesa 2.0 LFB address |
351 | BOOT_MTRR equ 0x901C ;byte 0 or 1 : enable MTRR graphics acceleration |
343 | BOOT_MTRR equ 0x901C ;byte 0 or 1 : enable MTRR graphics acceleration |
352 | BOOT_LOG equ 0x901D ;byte not used anymore (0 or 1 : enable system log display) |
344 | BOOT_LOG equ 0x901D ;byte not used anymore (0 or 1 : enable system log display) |
353 | ;BOOT_DIRECT_LFB equ 0x901E ;byte 0 or 1 : enable direct lfb write, paging disabled |
345 | ;BOOT_DIRECT_LFB equ 0x901E ;byte 0 or 1 : enable direct lfb write, paging disabled |
354 | BOOT_DMA equ 0x901F ; |
346 | BOOT_DMA equ 0x901F ; |
355 | BOOT_PCI_DATA equ 0x9020 ;8bytes pci data |
347 | BOOT_PCI_DATA equ 0x9020 ;8bytes pci data |
356 | BOOT_VRR equ 0x9030 ;byte VRR start enabled 1, 2-no |
348 | BOOT_VRR equ 0x9030 ;byte VRR start enabled 1, 2-no |
357 | BOOT_IDE_BASE_ADDR equ 0x9031 ;word IDEContrRegsBaseAddr |
349 | BOOT_IDE_BASE_ADDR equ 0x9031 ;word IDEContrRegsBaseAddr |
358 | BOOT_MEM_AMOUNT equ 0x9034 ;dword memory amount |
350 | BOOT_MEM_AMOUNT equ 0x9034 ;dword memory amount |
359 | 351 | ||
360 | BOOT_APM_ENTRY equ 0x9040 |
352 | BOOT_APM_ENTRY equ 0x9040 |
361 | BOOT_APM_VERSION equ 0x9044 |
353 | BOOT_APM_VERSION equ 0x9044 |
362 | BOOT_APM_FLAGS equ 0x9046 ;unused |
354 | BOOT_APM_FLAGS equ 0x9046 ;unused |
363 | BOOT_APM_CODE_32 equ 0x9050 |
355 | BOOT_APM_CODE_32 equ 0x9050 |
364 | BOOT_APM_CODE_16 equ 0x9052 |
356 | BOOT_APM_CODE_16 equ 0x9052 |
365 | BOOT_APM_DATA_16 equ 0x9054 |
357 | BOOT_APM_DATA_16 equ 0x9054 |
366 | 358 | ||
367 | TMP_FILE_NAME equ 0 |
359 | TMP_FILE_NAME equ 0 |
368 | TMP_CMD_LINE equ 1024 |
360 | TMP_CMD_LINE equ 1024 |
369 | TMP_ICON_OFFS equ 1280 |
361 | TMP_ICON_OFFS equ 1280 |
370 | 362 | ||
371 | 363 | ||
372 | EVENT_REDRAW equ 0x00000001 |
364 | EVENT_REDRAW equ 0x00000001 |
373 | EVENT_KEY equ 0x00000002 |
365 | EVENT_KEY equ 0x00000002 |
374 | EVENT_BUTTON equ 0x00000004 |
366 | EVENT_BUTTON equ 0x00000004 |
375 | EVENT_BACKGROUND equ 0x00000010 |
367 | EVENT_BACKGROUND equ 0x00000010 |
376 | EVENT_MOUSE equ 0x00000020 |
368 | EVENT_MOUSE equ 0x00000020 |
377 | EVENT_IPC equ 0x00000040 |
369 | EVENT_IPC equ 0x00000040 |
378 | EVENT_NETWORK equ 0x00000080 |
370 | EVENT_NETWORK equ 0x00000080 |
379 | EVENT_DEBUG equ 0x00000100 |
371 | EVENT_DEBUG equ 0x00000100 |
380 | EVENT_NETWORK2 equ 0x00000200 |
372 | EVENT_NETWORK2 equ 0x00000200 |
381 | EVENT_EXTENDED equ 0x00000400 |
373 | EVENT_EXTENDED equ 0x00000400 |
382 | 374 | ||
383 | EV_INTR equ 1 |
375 | EV_INTR equ 1 |
384 | 376 | ||
385 | struct THR_DATA |
377 | struct THR_DATA |
386 | rb (8192-512) |
378 | rb (8192-512) |
387 | ; pl0_stack |
379 | ; pl0_stack |
388 | fpu_state rb 512 |
380 | fpu_state rb 512 |
389 | tls_page rb 4096 |
381 | tls_page rb 4096 |
390 | pdbr rb 4096 |
382 | pdbr rb 4096 |
391 | ends |
383 | ends |
392 | 384 | ||
393 | virtual at (OS_BASE-sizeof.THR_DATA) |
385 | virtual at (OS_BASE-sizeof.THR_DATA) |
394 | thr_data THR_DATA |
386 | thr_data THR_DATA |
395 | end virtual |
387 | end virtual |
396 | 388 | ||
397 | struct SYS_VARS |
389 | struct SYS_VARS |
398 | bpp dd ? |
390 | bpp dd ? |
399 | scanline dd ? |
391 | scanline dd ? |
400 | vesa_mode dd ? |
392 | vesa_mode dd ? |
401 | x_res dd ? |
393 | x_res dd ? |
402 | y_res dd ? |
394 | y_res dd ? |
403 | ends |
395 | ends |
404 | 396 | ||
405 | struct APPOBJ ; common object header |
397 | struct APPOBJ ; common object header |
406 | magic dd ? ; |
398 | magic dd ? ; |
407 | destroy dd ? ; internal destructor |
399 | destroy dd ? ; internal destructor |
408 | fd dd ? ; next object in list |
400 | fd dd ? ; next object in list |
409 | bk dd ? ; prev object in list |
401 | bk dd ? ; prev object in list |
410 | pid dd ? ; owner id |
402 | pid dd ? ; owner id |
411 | ends |
403 | ends |
412 | 404 | ||
413 | APP_OBJ_OFFSET equ 48 |
405 | APP_OBJ_OFFSET equ 48 |
414 | APP_EV_OFFSET equ 40 |
406 | APP_EV_OFFSET equ 40 |
415 | 407 | ||
416 | struct CURSOR APPOBJ |
408 | struct CURSOR APPOBJ |
417 | base dd ? ;allocated memory |
409 | base dd ? ;allocated memory |
418 | hot_x dd ? ;hotspot coords |
410 | hot_x dd ? ;hotspot coords |
419 | hot_y dd ? |
411 | hot_y dd ? |
420 | 412 | ||
421 | list_next dd ? ;next cursor in cursor list |
413 | list_next dd ? ;next cursor in cursor list |
422 | list_prev dd ? ;prev cursor in cursor list |
414 | list_prev dd ? ;prev cursor in cursor list |
423 | dev_obj dd ? ;device depended data |
415 | dev_obj dd ? ;device depended data |
424 | ends |
416 | ends |
425 | 417 | ||
426 | 418 | ||
427 | struct EVENT APPOBJ |
419 | struct EVENT APPOBJ |
428 | id dd ? ;event uid |
420 | id dd ? ;event uid |
429 | state dd ? ;internal flags |
421 | state dd ? ;internal flags |
430 | code dd ? |
422 | code dd ? |
431 | rd 5 |
423 | rd 5 |
432 | ends |
424 | ends |
433 | 425 | ||
434 | 426 | ||
435 | struct SMEM |
427 | struct SMEM |
436 | bk dd ? |
428 | bk dd ? |
437 | fd dd ? ;+4 |
429 | fd dd ? ;+4 |
438 | base dd ? ;+8 |
430 | base dd ? ;+8 |
439 | size dd ? ;+12 |
431 | size dd ? ;+12 |
440 | access dd ? ;+16 |
432 | access dd ? ;+16 |
441 | refcount dd ? ;+20 |
433 | refcount dd ? ;+20 |
442 | name rb 32 ;+24 |
434 | name rb 32 ;+24 |
443 | ends |
435 | ends |
444 | 436 | ||
445 | struct SMAP APPOBJ |
437 | struct SMAP APPOBJ |
446 | base dd ? ;mapped base |
438 | base dd ? ;mapped base |
447 | parent dd ? ;SMEM |
439 | parent dd ? ;SMEM |
448 | ends |
440 | ends |
449 | 441 | ||
450 | struct DLLDESCR |
442 | struct DLLDESCR |
451 | bk dd ? |
443 | bk dd ? |
452 | fd dd ? ;+4 |
444 | fd dd ? ;+4 |
453 | data dd ? ;+8 |
445 | data dd ? ;+8 |
454 | size dd ? ;+12 |
446 | size dd ? ;+12 |
455 | timestamp dq ? |
447 | timestamp dq ? |
456 | refcount dd ? |
448 | refcount dd ? |
457 | defaultbase dd ? |
449 | defaultbase dd ? |
458 | coff_hdr dd ? |
450 | coff_hdr dd ? |
459 | symbols_ptr dd ? |
451 | symbols_ptr dd ? |
460 | symbols_num dd ? |
452 | symbols_num dd ? |
461 | symbols_lim dd ? |
453 | symbols_lim dd ? |
462 | exports dd ? ;export table |
454 | exports dd ? ;export table |
463 | name rb 260 |
455 | name rb 260 |
464 | ends |
456 | ends |
465 | 457 | ||
466 | struct HDLL |
458 | struct HDLL |
467 | fd dd ? ;next object in list |
459 | fd dd ? ;next object in list |
468 | bk dd ? ;prev object in list |
460 | bk dd ? ;prev object in list |
469 | pid dd ? ;owner id |
461 | pid dd ? ;owner id |
470 | 462 | ||
471 | base dd ? ;mapped base |
463 | base dd ? ;mapped base |
472 | size dd ? ;mapped size |
464 | size dd ? ;mapped size |
473 | refcount dd ? ;reference counter for this process and this lib |
465 | refcount dd ? ;reference counter for this process and this lib |
474 | parent dd ? ;DLLDESCR |
466 | parent dd ? ;DLLDESCR |
475 | ends |
467 | ends |
476 | 468 | ||
477 | struct display_t |
469 | struct display_t |
478 | x dd ? |
470 | x dd ? |
479 | y dd ? |
471 | y dd ? |
480 | width dd ? |
472 | width dd ? |
481 | height dd ? |
473 | height dd ? |
482 | bpp dd ? |
474 | bpp dd ? |
483 | vrefresh dd ? |
475 | vrefresh dd ? |
484 | pitch dd ? |
476 | pitch dd ? |
485 | lfb dd ? |
477 | lfb dd ? |
486 | 478 | ||
487 | modes dd ? |
479 | modes dd ? |
488 | ddev dd ? |
480 | ddev dd ? |
489 | connector dd ? |
481 | connector dd ? |
490 | crtc dd ? |
482 | crtc dd ? |
491 | 483 | ||
492 | cr_list.next dd ? |
484 | cr_list.next dd ? |
493 | cr_list.prev dd ? |
485 | cr_list.prev dd ? |
494 | 486 | ||
495 | cursor dd ? |
487 | cursor dd ? |
496 | 488 | ||
497 | init_cursor dd ? |
489 | init_cursor dd ? |
498 | select_cursor dd ? |
490 | select_cursor dd ? |
499 | show_cursor dd ? |
491 | show_cursor dd ? |
500 | move_cursor dd ? |
492 | move_cursor dd ? |
501 | restore_cursor dd ? |
493 | restore_cursor dd ? |
502 | disable_mouse dd ? |
494 | disable_mouse dd ? |
503 | mask_seqno dd ? |
495 | mask_seqno dd ? |
504 | check_mouse dd ? |
496 | check_mouse dd ? |
505 | check_m_pixel dd ? |
497 | check_m_pixel dd ? |
506 | ends |
498 | ends |
507 | 499 | ||
508 | struct BOOT_DATA |
500 | struct BOOT_DATA |
509 | bpp dd ? |
501 | bpp dd ? |
510 | scanline dd ? |
502 | scanline dd ? |
511 | vesa_mode dd ? |
503 | vesa_mode dd ? |
512 | x_res dd ? |
504 | x_res dd ? |
513 | y_res dd ? |
505 | y_res dd ? |
514 | mouse_port dd ? |
506 | mouse_port dd ? |
515 | bank_switch dd ? |
507 | bank_switch dd ? |
516 | lfb dd ? |
508 | lfb dd ? |
517 | vesa_mem dd ? |
509 | vesa_mem dd ? |
518 | log dd ? |
510 | log dd ? |
519 | direct_lfb dd ? |
511 | direct_lfb dd ? |
520 | pci_data dd ? |
512 | pci_data dd ? |
521 | dd ? |
513 | dd ? |
522 | vrr dd ? |
514 | vrr dd ? |
523 | ide_base dd ? |
515 | ide_base dd ? |
524 | mem_amount dd ? |
516 | mem_amount dd ? |
525 | pages_count dd ? |
517 | pages_count dd ? |
526 | pagemap_size dd ? |
518 | pagemap_size dd ? |
527 | kernel_max dd ? |
519 | kernel_max dd ? |
528 | kernel_pages dd ? |
520 | kernel_pages dd ? |
529 | kernel_tables dd ? |
521 | kernel_tables dd ? |
530 | 522 | ||
531 | cpu_vendor dd ? |
523 | cpu_vendor dd ? |
532 | dd ? |
524 | dd ? |
533 | dd ? |
525 | dd ? |
534 | cpu_sign dd ? |
526 | cpu_sign dd ? |
535 | cpu_info dd ? |
527 | cpu_info dd ? |
536 | cpu_caps dd ? |
528 | cpu_caps dd ? |
537 | dd ? |
529 | dd ? |
538 | dd ? |
530 | dd ? |
539 | ends |
531 | ends |
540 | 532 | ||
541 | struct LHEAD |
533 | struct LHEAD |
542 | next dd ? ;next object in list |
534 | next dd ? ;next object in list |
543 | prev dd ? ;prev object in list |
535 | prev dd ? ;prev object in list |
544 | ends |
536 | ends |
545 | 537 | ||
546 | struct MUTEX |
538 | struct MUTEX |
547 | lhead LHEAD |
539 | lhead LHEAD |
548 | count dd ? |
540 | count dd ? |
549 | ends |
541 | ends |
550 | 542 | ||
551 | struct PCIDEV |
543 | struct PCIDEV |
552 | bk dd ? |
544 | bk dd ? |
553 | fd dd ? |
545 | fd dd ? |
554 | vendor_device_id dd ? |
546 | vendor_device_id dd ? |
555 | class dd ? |
547 | class dd ? |
556 | devfn db ? |
548 | devfn db ? |
557 | bus db ? |
549 | bus db ? |
558 | ends |
550 | ends |
559 | 551 | ||
560 | ; The following macro assume that we are on uniprocessor machine. |
552 | ; The following macro assume that we are on uniprocessor machine. |
561 | ; Serious work is needed for multiprocessor machines. |
553 | ; Serious work is needed for multiprocessor machines. |
562 | macro spin_lock_irqsave spinlock |
554 | macro spin_lock_irqsave spinlock |
563 | { |
555 | { |
564 | pushf |
556 | pushf |
565 | cli |
557 | cli |
566 | } |
558 | } |
567 | macro spin_unlock_irqrestore spinlock |
559 | macro spin_unlock_irqrestore spinlock |
568 | { |
560 | { |
569 | popf |
561 | popf |
570 | } |
562 | } |
571 | macro spin_lock_irq spinlock |
563 | macro spin_lock_irq spinlock |
572 | { |
564 | { |
573 | cli |
565 | cli |
574 | } |
566 | } |
575 | macro spin_unlock_irq spinlock |
567 | macro spin_unlock_irq spinlock |
576 | { |
568 | { |
577 | sti |
569 | sti |
578 | } |
570 | } |
579 | 571 | ||
580 | struct MEM_STATE |
572 | struct MEM_STATE |
581 | mutex MUTEX |
573 | mutex MUTEX |
582 | smallmap dd ? |
574 | smallmap dd ? |
583 | treemap dd ? |
575 | treemap dd ? |
584 | topsize dd ? |
576 | topsize dd ? |
585 | top dd ? |
577 | top dd ? |
586 | smallbins rd 4*32 |
578 | smallbins rd 4*32 |
587 | treebins rd 32 |
579 | treebins rd 32 |
588 | ends |
580 | ends |
589 | 581 | ||
590 | struct PG_DATA |
582 | struct PG_DATA |
591 | mem_amount dd ? |
583 | mem_amount dd ? |
592 | vesa_mem dd ? |
584 | vesa_mem dd ? |
593 | pages_count dd ? |
585 | pages_count dd ? |
594 | pages_free dd ? |
586 | pages_free dd ? |
595 | pages_faults dd ? |
587 | pages_faults dd ? |
596 | pagemap_size dd ? |
588 | pagemap_size dd ? |
597 | kernel_pages dd ? |
589 | kernel_pages dd ? |
598 | kernel_tables dd ? |
590 | kernel_tables dd ? |
599 | sys_page_dir dd ? |
591 | sys_page_dir dd ? |
600 | mutex MUTEX |
592 | mutex MUTEX |
601 | ends |
593 | ends |
602 | 594 | ||
603 | struct SRV |
595 | struct SRV |
604 | srv_name rb 16 ;ASCIIZ string |
596 | srv_name rb 16 ;ASCIIZ string |
605 | magic dd ? ;+0x10 ;'SRV ' |
597 | magic dd ? ;+0x10 ;'SRV ' |
606 | size dd ? ;+0x14 ;size of structure SRV |
598 | size dd ? ;+0x14 ;size of structure SRV |
607 | fd dd ? ;+0x18 ;next SRV descriptor |
599 | fd dd ? ;+0x18 ;next SRV descriptor |
608 | bk dd ? ;+0x1C ;prev SRV descriptor |
600 | bk dd ? ;+0x1C ;prev SRV descriptor |
609 | base dd ? ;+0x20 ;service base address |
601 | base dd ? ;+0x20 ;service base address |
610 | entry dd ? ;+0x24 ;service START function |
602 | entry dd ? ;+0x24 ;service START function |
611 | srv_proc dd ? ;+0x28 ;user mode service handler |
603 | srv_proc dd ? ;+0x28 ;user mode service handler |
612 | srv_proc_ex dd ? ;+0x2C ;kernel mode service handler |
604 | srv_proc_ex dd ? ;+0x2C ;kernel mode service handler |
613 | ends |
605 | ends |
614 | 606 | ||
615 | struct USBSRV |
607 | struct USBSRV |
616 | srv SRV |
608 | srv SRV |
617 | usb_func dd ? |
609 | usb_func dd ? |
618 | ends |
610 | ends |
619 | 611 | ||
620 | struct USBFUNC |
612 | struct USBFUNC |
621 | strucsize dd ? |
613 | strucsize dd ? |
622 | add_device dd ? |
614 | add_device dd ? |
623 | device_disconnect dd ? |
615 | device_disconnect dd ? |
624 | ends |
616 | ends |
625 | 617 | ||
626 | DRV_ENTRY equ 1 |
618 | DRV_ENTRY equ 1 |
627 | DRV_EXIT equ -1 |
619 | DRV_EXIT equ -1 |
628 | 620 | ||
629 | struct COFF_HEADER |
621 | struct COFF_HEADER |
630 | machine dw ? |
622 | machine dw ? |
631 | nSections dw ? |
623 | nSections dw ? |
632 | DataTime dd ? |
624 | DataTime dd ? |
633 | pSymTable dd ? |
625 | pSymTable dd ? |
634 | nSymbols dd ? |
626 | nSymbols dd ? |
635 | optHeader dw ? |
627 | optHeader dw ? |
636 | flags dw ? |
628 | flags dw ? |
637 | ends |
629 | ends |
638 | 630 | ||
639 | struct COFF_SECTION |
631 | struct COFF_SECTION |
640 | Name rb 8 |
632 | Name rb 8 |
641 | VirtualSize dd ? |
633 | VirtualSize dd ? |
642 | VirtualAddress dd ? |
634 | VirtualAddress dd ? |
643 | SizeOfRawData dd ? |
635 | SizeOfRawData dd ? |
644 | PtrRawData dd ? |
636 | PtrRawData dd ? |
645 | PtrReloc dd ? |
637 | PtrReloc dd ? |
646 | PtrLinenumbers dd ? |
638 | PtrLinenumbers dd ? |
647 | NumReloc dw ? |
639 | NumReloc dw ? |
648 | NumLinenum dw ? |
640 | NumLinenum dw ? |
649 | Characteristics dd ? |
641 | Characteristics dd ? |
650 | ends |
642 | ends |
651 | 643 | ||
652 | struct COFF_RELOC |
644 | struct COFF_RELOC |
653 | VirtualAddress dd ? |
645 | VirtualAddress dd ? |
654 | SymIndex dd ? |
646 | SymIndex dd ? |
655 | Type dw ? |
647 | Type dw ? |
656 | ends |
648 | ends |
657 | 649 | ||
658 | struct COFF_SYM |
650 | struct COFF_SYM |
659 | Name rb 8 |
651 | Name rb 8 |
660 | Value dd ? |
652 | Value dd ? |
661 | SectionNumber dw ? |
653 | SectionNumber dw ? |
662 | Type dw ? |
654 | Type dw ? |
663 | StorageClass db ? |
655 | StorageClass db ? |
664 | NumAuxSymbols db ? |
656 | NumAuxSymbols db ? |
665 | ends |
657 | ends |
666 | 658 | ||
667 | struct IOCTL |
659 | struct IOCTL |
668 | handle dd ? |
660 | handle dd ? |
669 | io_code dd ? |
661 | io_code dd ? |
670 | input dd ? |
662 | input dd ? |
671 | inp_size dd ? |
663 | inp_size dd ? |
672 | output dd ? |
664 | output dd ? |
673 | out_size dd ? |
665 | out_size dd ? |
674 | ends |
666 | ends |
675 | 667 | ||
676 | struct IRQH |
668 | struct IRQH |
677 | list LHEAD |
669 | list LHEAD |
678 | handler dd ? ;handler roututine |
670 | handler dd ? ;handler roututine |
679 | data dd ? ;user-specific data |
671 | data dd ? ;user-specific data |
680 | num_ints dd ? ;how many times handled |
672 | num_ints dd ? ;how many times handled |
681 | ends |
673 | ends |