Subversion Repositories Kolibri OS

Rev

Rev 789 | Rev 891 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 789 Rev 820
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2007-2008. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2007-2008. 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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
$Revision: 789 $
8
$Revision: 820 $
9
 
9
 
Line 10... Line 10...
10
; Virtual-8086 mode manager
10
; Virtual-8086 mode manager
Line 87... Line 87...
87
        or      al, PG_SW
87
        or      al, PG_SW
88
        mov [edi-4096+(page_tabs shr 20)], eax
88
        mov [edi-4096+(page_tabs shr 20)], eax
Line 89... Line 89...
89
 
89
 
90
        pop     esi
90
        pop     esi
91
; now V86 specific: initialize known addresses in first Mb
91
; now V86 specific: initialize known addresses in first Mb
92
        pop     eax edi
92
        pop     eax
93
; first page - BIOS data (shared between all machines!)
93
; first page - BIOS data (shared between all machines!)
94
; physical address = 0x2f0000
94
; physical address = 0x2f0000
95
; linear address = BOOT_VAR = OS_BASE + 0x2f0000
95
; linear address = BOOT_VAR = OS_BASE + 0x2f0000
96
        mov     dword [eax], (BOOT_VAR - OS_BASE) or 111b
96
        mov     dword [eax], (BOOT_VAR - OS_BASE) or 111b
97
        mov     dword [eax+800h], BOOT_VAR
97
        mov     dword [eax+800h], BOOT_VAR
98
; page before 0xA0000 - Extended BIOS Data Area (shared between all machines!)
98
; page before 0xA0000 - Extended BIOS Data Area (shared between all machines!)
99
; physical address = 0x9F000
99
; physical address = 0x9C000
-
 
100
; linear address = 0x8009C000
-
 
101
; (I have seen one computer with EBDA segment = 0x9D80,
-
 
102
; all other computers use less memory)
-
 
103
        mov     ecx, 4
-
 
104
        mov     edx, 0x9C000
100
; linear address = 0x8009F000
105
        push    eax
-
 
106
        lea     edi, [eax+0x9C*4]
101
        mov     dword [eax+0x9E*4], 0x9E000 or 111b
107
@@:
102
        mov     dword [eax+0x9E*4+800h], 0x9E000 + OS_BASE
108
        lea     eax, [edx + OS_BASE]
103
        mov     dword [eax+0x9F*4], 0x9F000 or 111b
109
        mov     [edi+800h], eax
-
 
110
        lea     eax, [edx + 111b]
-
 
111
        stosd
-
 
112
        loop    @b
-
 
113
        pop     eax
104
        mov     dword [eax+0x9F*4+800h], 0x9F000 + OS_BASE
114
        pop     edi
105
; addresses 0xC0000 - 0xFFFFF - BIOS code (shared between all machines!)
115
; addresses 0xC0000 - 0xFFFFF - BIOS code (shared between all machines!)
106
; physical address = 0xC0000
116
; physical address = 0xC0000
107
; linear address = 0x800C0000
117
; linear address = 0x800C0000
108
        mov     ecx, 0xC0
118
        mov     ecx, 0xC0
Line 214... Line 224...
214
        mov     byte [BOOT_VAR + 0x503], 0xCD
224
        mov     byte [BOOT_VAR + 0x503], 0xCD
215
        mov     byte [BOOT_VAR + 0x504], 0x10
225
        mov     byte [BOOT_VAR + 0x504], 0x10
216
        mov     byte [BOOT_VAR + 0x505], 0xF4
226
        mov     byte [BOOT_VAR + 0x505], 0xF4
217
        mov     esi, eax
227
        mov     esi, eax
218
        mov     ebx, [eax+V86_machine.pagedir]
228
        mov     ebx, [eax+V86_machine.pagedir]
-
 
229
; one page for stack, two pages for results (0x2000 bytes = 16 sectors)
-
 
230
        mov     dword [ebx+0x99*4+0x1000], 0x99000 or 111b
-
 
231
        mov     dword [ebx+0x99*4+0x1800], OS_BASE + 0x99000
-
 
232
        mov     dword [ebx+0x9A*4+0x1000], 0x9A000 or 111b
-
 
233
        mov     dword [ebx+0x9A*4+0x1800], OS_BASE + 0x9A000
219
        mov     dword [ebx+0x9B*4+0x1000], 0x9B000 or 111b
234
        mov     dword [ebx+0x9B*4+0x1000], 0x9B000 or 111b
220
        mov     dword [ebx+0x9B*4+0x1800], OS_BASE + 0x9B000
235
        mov     dword [ebx+0x9B*4+0x1800], OS_BASE + 0x9B000
221
        mov     dword [ebx+0x9C*4+0x1000], 0x9C000 or 111b
-
 
222
        mov     dword [ebx+0x9C*4+0x1800], OS_BASE + 0x9C000
-
 
223
        mov     dword [ebx+0x9D*4+0x1000], 0x9D000 or 111b
-
 
224
        mov     dword [ebx+0x9D*4+0x1800], OS_BASE + 0x9D000
-
 
225
if ~DEBUG_SHOW_IO
236
if ~DEBUG_SHOW_IO
226
; allow access to all ports
237
; allow access to all ports
227
        mov     ecx, [esi+V86_machine.iopm]
238
        mov     ecx, [esi+V86_machine.iopm]
228
        xor     eax, eax
239
        xor     eax, eax
229
        mov     edi, ecx
240
        mov     edi, ecx