Subversion Repositories Kolibri OS

Rev

Rev 1220 | Rev 1260 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 ha 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;
709 diamond 3
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved.
431 serge 4
;; PROGRAMMING:
5
;; Ivan Poddubny
6
;; Marat Zakiyanov (Mario79)
7
;; VaStaNi
8
;; Trans
9
;; Mihail Semenyako (mike.dld)
10
;; Sergey Kuzmin (Wildwest)
11
;; Andrey Halyavin (halyavin)
12
;; Mihail Lisovin (Mihasik)
13
;; Andrey Ignatiev (andrew_programmer)
14
;; NoName
15
;; Evgeny Grechnikov (Diamond)
16
;; Iliya Mihailov (Ghost)
17
;; Sergey Semyonov (Serge)
18
;; Johnny_B
543 spraid 19
;; SPraid (simba)
1043 hidnplayr 20
;; Hidnplayr
1 ha 21
;;
431 serge 22
;; Data in this file was originally part of MenuetOS project which is
23
;; distributed under the terms of GNU GPL. It is modified and redistributed as
24
;; part of KolibriOS project under the terms of GNU GPL.
1 ha 25
;;
431 serge 26
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa
27
;; PROGRAMMING:
1 ha 28
;;
431 serge 29
;; Ville Mikael Turjanmaa, villemt@itu.jyu.fi
30
;; - main os coding/design
31
;; Jan-Michael Brummer, BUZZ2@gmx.de
32
;; Felix Kaiser, info@felix-kaiser.de
33
;; Paolo Minazzi, paolo.minazzi@inwind.it
34
;; quickcode@mail.ru
35
;; Alexey, kgaz@crosswinds.net
36
;; Juan M. Caravaca, bitrider@wanadoo.es
37
;; kristol@nic.fi
38
;; Mike Hibbett, mikeh@oceanfree.net
39
;; Lasse Kuusijarvi, kuusijar@lut.fi
40
;; Jarek Pelczar, jarekp3@wp.pl
1 ha 41
;;
431 serge 42
;; KolibriOS is distributed in the hope that it will be useful, but WITHOUT ANY
43
;; WARRANTY. No author or distributor accepts responsibility to anyone for the
44
;; consequences of using it or for whether it serves any particular purpose or
45
;; works at all, unless he says so in writing. Refer to the GNU General Public
46
;; License (the "GPL") for full details.
47
;
48
;; Everyone is granted permission to copy, modify and redistribute KolibriOS,
49
;; but only under the conditions described in the GPL. A copy of this license
50
;; is supposed to have been given to you along with KolibriOS so you can know
51
;; your rights and responsibilities. It should be in a file named COPYING.
52
;; Among other things, the copyright notice and this notice must be preserved
53
;; on all copies.
54
;;
1 ha 55
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
426 mikedld 56
 
57
include 'macros.inc'
58
 
425 victor 59
$Revision: 1232 $
426 mikedld 60
 
593 mikedld 61
 
1055 Galkov 62
USE_COM_IRQ     equ 1      ; make irq 3 and irq 4 available for PCI devices
566 serge 63
 
1043 hidnplayr 64
; Enabling the next line will enable serial output console
65
;debug_com_base  equ 0x3f8  ; 0x3f8 is com1, 0x2f8 is com2, 0x3e8 is com3, 0x2e8 is com4, no irq's are used
66
 
164 serge 67
include "proc32.inc"
7 me_root 68
include "kglobals.inc"
1 ha 69
include "lang.inc"
70
 
164 serge 71
include "const.inc"
1055 Galkov 72
max_processes    equ   255
73
tss_step         equ   (128+8192) ; tss & i/o - 65535 ports, * 256=557056*4
1 ha 74
 
164 serge 75
 
1055 Galkov 76
os_stack       equ  (os_data_l-gdts)    ; GDTs
465 serge 77
os_code        equ  (os_code_l-gdts)
78
graph_data     equ  (3+graph_data_l-gdts)
1055 Galkov 79
tss0           equ  (tss0_l-gdts)
465 serge 80
app_code       equ  (3+app_code_l-gdts)
81
app_data       equ  (3+app_data_l-gdts)
1220 serge 82
app_tls        equ  (3+tls_data_l-gdts)
586 serge 83
pci_code_sel   equ  (pci_code_32-gdts)
84
pci_data_sel   equ  (pci_data_32-gdts)
1 ha 85
 
86
 
87
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
88
;;
89
;;   Included files:
90
;;
91
;;   Kernel16.inc
92
;;    - Booteng.inc   English text for bootup
93
;;    - Bootcode.inc  Hardware setup
94
;;    - Pci16.inc     PCI functions
95
;;
96
;;   Kernel32.inc
97
;;    - Sys32.inc     Process management
98
;;    - Shutdown.inc  Shutdown and restart
99
;;    - Fat32.inc     Read / write hd
100
;;    - Vesa12.inc    Vesa 1.2 driver
101
;;    - Vesa20.inc    Vesa 2.0 driver
102
;;    - Vga.inc       VGA driver
103
;;    - Stack.inc     Network interface
104
;;    - Mouse.inc     Mouse pointer
105
;;    - Scincode.inc  Window skinning
106
;;    - Pci32.inc     PCI functions
107
;;
108
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
109
 
110
 
111
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
112
;;                                                                      ;;
113
;;                  16 BIT ENTRY FROM BOOTSECTOR                        ;;
114
;;                                                                      ;;
115
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
116
 
117
use16
1055 Galkov 118
                  org   0x0
119
                  jmp   start_of_code
1 ha 120
 
1018 diamond 121
version db    'Kolibri OS  version 0.7.5.0      ',13,10,13,10,0
1 ha 122
 
465 serge 123
include "boot/bootstr.inc"     ; language-independent boot messages
1 ha 124
include "boot/preboot.inc"
125
 
465 serge 126
if lang eq en
127
include "boot/booteng.inc"     ; english system boot messages
128
else if lang eq ru
129
include "boot/bootru.inc"      ; russian system boot messages
1055 Galkov 130
include "boot/ru.inc"          ; Russian font
465 serge 131
else if lang eq et
132
include "boot/bootet.inc"      ; estonian system boot messages
1055 Galkov 133
include "boot/et.inc"          ; Estonian font
465 serge 134
else
135
include "boot/bootge.inc"      ; german system boot messages
136
end if
1 ha 137
 
465 serge 138
include "boot/bootcode.inc"    ; 16 bit system boot code
139
include "bus/pci/pci16.inc"
709 diamond 140
include "detect/biosdisk.inc"
1 ha 141
 
142
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
143
;;                                                                      ;;
144
;;                  SWITCH TO 32 BIT PROTECTED MODE                     ;;
145
;;                                                                      ;;
146
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
147
 
148
 
149
; CR0 Flags - Protected mode and Paging
150
 
1055 Galkov 151
        mov ecx, CR0_PE
1 ha 152
 
153
; Enabling 32 bit protected mode
154
 
1055 Galkov 155
        sidt    [cs:old_ints_h]
1 ha 156
 
1055 Galkov 157
        cli                             ; disable all irqs
158
        cld
159
        mov     al,255                  ; mask all irqs
160
        out     0xa1,al
161
        out     0x21,al
162
   l.5: in      al, 0x64                ; Enable A20
163
        test    al, 2
164
        jnz     l.5
165
        mov     al, 0xD1
166
        out     0x64, al
167
   l.6: in      al, 0x64
168
        test    al, 2
169
        jnz     l.6
170
        mov     al, 0xDF
171
        out     0x60, al
172
   l.7: in      al, 0x64
173
        test    al, 2
174
        jnz     l.7
175
        mov     al, 0xFF
176
        out     0x64, al
465 serge 177
 
1055 Galkov 178
        lgdt    [cs:tmp_gdt]            ; Load GDT
179
        mov     eax, cr0                ; protected mode
180
        or      eax, ecx
181
        and     eax, 10011111b *65536*256 + 0xffffff ; caching enabled
182
        mov     cr0, eax
183
        jmp     pword os_code:B32       ; jmp to enable 32 bit mode
1 ha 184
 
465 serge 185
align 8
186
tmp_gdt:
1 ha 187
 
1055 Galkov 188
        dw     23
189
        dd     tmp_gdt+0x10000
190
        dw     0
183 diamond 191
 
1055 Galkov 192
        dw     0xffff
193
        dw     0x0000
194
        db     0x00
195
        dw     11011111b *256 +10011010b
196
        db     0x00
375 Ghost 197
 
1055 Galkov 198
        dw     0xffff
199
        dw     0x0000
200
        db     0x00
201
        dw     11011111b *256 +10010010b
202
        db     0x00
1 ha 203
 
465 serge 204
include "data16.inc"
1 ha 205
 
465 serge 206
use32
207
org $+0x10000
1 ha 208
 
465</