Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
4429 Serge 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
3
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7
 
8
$Revision: 4278 $
9
 
10
 
11
keymap:
12
 
13
     db   '6',27
14
     db   '1234567890-=',8,9
15
     db   'qwertyuiop[]',13
16
     db   '~asdfghjkl;',39,96,0,'\zxcvbnm,./',0,'45 '
17
     db   '@234567890123',180,178,184,'6',176,'7'
18
     db   179,'8',181,177,183,185,182
19
     db   'AB
20
     db   'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
21
     db   'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
22
     db   'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
23
 
24
keymap_shift:
25
     db   '6',27
26
     db   '!@#$%^&*()_+',8,9
27
     db   'QWERTYUIOP{}',13
28
     db   '~ASDFGHJKL:"~',0,'|ZXCVBNM<>?',0,'45 '
29
     db   '@234567890123',180,178,184,'6',176,'7'
30
     db   179,'8',181,177,183,185,182
31
     db   'AB>D',255,'FGHIJKLMNOPQRSTUVWXYZ'
32
     db   'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
33
     db   'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
34
     db   'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
35
 
36
 
37
keymap_alt:
38
     db   ' ',27
39
     db   ' @ $  {[]}\ ',8,9
40
     db   '            ',13
41
     db   '             ',0,'           ',0,'4',0,' '
42
     db   '             ',180,178,184,'6',176,'7'
43
     db   179,'8',181,177,183,185,182
44
     db   'ABCD',255,'FGHIJKLMNOPQRSTUVWXYZ'
45
     db   'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
46
     db   'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
47
     db   'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
48
 
49
 
50
 
51
if lang eq ru
52
  boot_initirq      cp866 'Инициализация IRQ',0
53
  boot_picinit      cp866 'Инициализация PIC',0
54
  boot_v86machine   cp866 'Инициализация системной V86 машины',0
55
  boot_inittimer    cp866 'Инициализация системного таймера (IRQ0)',0
56
  boot_initapic     cp866 'Попытка инициализации APIC',0
57
  boot_enableirq    cp866 'Включить прерывания 2, 13',0
58
  boot_disabling_ide cp866 'Запрещение прерываний в контроллере IDE',0
59
  boot_enabling_ide cp866 'Разрешение прерываний в контроллере IDE',0
60
  boot_set_int_IDE  cp866 'Установка обработчиков прерываний IDE',0
61
  boot_detectfloppy cp866 'Поиск floppy дисководов',0
62
  boot_detecthdcd   cp866 'Поиск жестких дисков и ATAPI приводов',0
63
  boot_getcache     cp866 'Получение памяти для кэша',0
64
  boot_detectpart   cp866 'Поиск разделов на дисковых устройствах',0
65
  boot_init_sys     cp866 'Инициализация системного каталога /sys',0
66
  boot_loadlibs     cp866 'Загрузка библиотек (.obj)',0
67
  boot_memdetect    cp866 'Количество оперативной памяти','     ',' Мб',0
68
  boot_tss          cp866 'Установка TSSs',0
69
  boot_cpuid        cp866 'Чтение CPUIDs',0
70
;  boot_devices      cp866 'Поиск устройств',0
71
  boot_timer        cp866 'Установка таймера',0
72
  boot_initramdisk  cp866 'Инициализация рамдиска',0
73
  boot_irqs         cp866 'Переопределение IRQ',0
74
  boot_setmouse     cp866 'Установка мыши',0
75
  boot_windefs      cp866 'Установка настроек окон по умолчанию',0
76
  boot_bgr          cp866 'Установка фона',0
77
  boot_resirqports  cp866 'Резервирование IRQ и портов',0
78
  boot_setrports    cp866 'Установка адресов IRQ',0
79
  boot_setostask    cp866 'Создание процесса ядра',0
80
  boot_allirqs      cp866 'Открытие всех IRQ',0
81
  boot_tsc          cp866 'Чтение TSC',0
82
  boot_cpufreq      cp866 'Частота процессора ','    ',' МГц',0
83
  boot_pal_ega      cp866 'Установка EGA/CGA 320x200 палитры',0
84
  boot_pal_vga      cp866 'Установка VGA 640x480 палитры',0
85
  boot_failed       cp866 'Загрузка первого приложения не удалась',0
86
  boot_mtrr         cp866 'Установка MTRR',0
87
 
88
  boot_APIC_found   cp866 'APIC включен', 0
89
  boot_APIC_nfound  cp866 'APIC не найден', 0
90
if preboot_blogesc
91
  boot_tasking      cp866 'Все готово для запуска, нажмитре ESC для старта',0
92
end if
93
else if lang eq sp
94
  include 'data32sp.inc'
95
else if lang eq et
96
  include 'data32et.inc'
97
else
98
  boot_initirq      db   'Initialize IRQ',0
99
  boot_picinit      db   'Initialize PIC',0
100
  boot_v86machine   db   'Initialize system V86 machine',0
101
  boot_inittimer    db   'Initialize system timer (IRQ0)',0
102
  boot_initramdisk  db   'Initialize ramdisk',0
103
  boot_initapic     db   'Try to initialize APIC',0
104
  boot_enableirq    db   'Enable interrupts 2, 13',0
105
  boot_disabling_ide db   'Disable interrupts in IDE controller',0
106
  boot_enabling_ide db   'Enable interrupts in IDE controller',0
107
  boot_set_int_IDE  db   'Set handler of interrupts for IDE',0
108
  boot_detectfloppy db   'Search floppy drives',0
109
  boot_detecthdcd   db   'Search hard drives and ATAPI drives',0
110
  boot_getcache     db   'Get memory for cache',0
111
  boot_detectpart   db   'Search partitions on disk devices',0
112
  boot_init_sys     db   'Initialize system directory /sys',0
113
  boot_loadlibs     db   'Loading librares (.obj)',0
114
  boot_memdetect    db   'Determining amount of memory',0
115
  boot_tss          db   'Setting TSSs',0
116
  boot_cpuid        db   'Reading CPUIDs',0
117
;  boot_devices      db   'Detecting devices',0
118
  boot_setmouse     db   'Setting mouse',0
119
  boot_windefs      db   'Setting window defaults',0
120
  boot_bgr          db   'Calculating background',0
121
  boot_resirqports  db   'Reserving IRQs & ports',0
122
  boot_setostask    db   'Setting OS task',0
123
  boot_allirqs      db   'Unmasking IRQs',0
124
  boot_tsc          db   'Reading TSC',0
125
  boot_cpufreq      db   'CPU frequency is ','    ',' MHz',0
126
  boot_pal_ega      db   'Setting EGA/CGA 320x200 palette',0
127
  boot_pal_vga      db   'Setting VGA 640x480 palette',0
128
  boot_failed       db   'Failed to start first app',0
129
  boot_mtrr         db   'Setting MTRR',0
130
 
131
  boot_APIC_found   db   'APIC enabled', 0
132
  boot_APIC_nfound  db   'APIC not found', 0
133
if preboot_blogesc
134
  boot_tasking      db   'All set - press ESC to start',0
135
end if
136
end if
137
 
138
;new_process_loading db 'K : New Process - loading',13,10,0
139
;new_process_running db 'K : New Process - done',13,10,0
140
start_not_enough_memory db 'K : New Process - not enough memory',13,10,0
141
 
142
msg_unresolved db 'unresolved ',0
143
msg_module     db 'in module ',0
144
if ~ lang eq sp
145
msg_version    db 'incompatible driver version',13,10,0
146
msg_www        db 'please visit www.kolibrios.org',13,10,0
147
end if
148
msg_CR         db  13,10,0
149
 
150
intel_str      db "GenuineIntel",0
151
AMD_str        db "AuthenticAMD",0
152
 
153
szHwMouse       db 'ATI2D',0
154
szPS2MDriver    db 'PS2MOUSE',0
155
;szCOM_MDriver   db 'COM_MOUSE',0
156
szVidintel      db 'vidintel',0
157
szUSB           db 'USB',0
158
szAtiHW         db '/rd/1/drivers/ati2d.drv',0
159
 
160
szSTART        db 'START',0
161
szEXPORTS      db 'EXPORTS',0
162
sz_EXPORTS     db '_EXPORTS',0
163
 
164
szIMPORTS      db 'IMPORTS',0
165
 
166
read_firstapp  db '/sys/'
167
firstapp       db  'LAUNCHER',0
168
notifyapp      db '@notify',0
169
if lang eq ru
170
ud_user_message  cp866 'Ошибка: неподдерживаемая инструкция процессора',0
4923 Serge 171
mtrr_user_message cp866 '"Обнаружена проблема с конфигурацией MTRR.\nПроизводительность может быть пониженной" -dW',0
4429 Serge 172
else if ~ lang eq sp
173
ud_user_message db 'Error: unsupported processor instruction',0
4923 Serge 174
mtrr_user_message db '"There is a problem with MTRR configuration.\nPerformance can be low" -dW',0
4429 Serge 175
end if
176
 
177
vmode          db  '/sys/drivers/VMODE.MDR',0
178
;vrr_m          db  'VRR_M',0
179
kernel_file_load:
180
; load kernel.mnt to 0x7000:0
181
        dd      0       ; subfunction
182
        dq      0       ; offset in file
183
        dd      0x30000 ; number of bytes to read
184
        dd      OS_BASE + 0x70000 ; buffer for data
185
        db      '/RD/1/KERNEL.MNT',0
186
 
187
dev_data_path  db '/RD/1/DRIVERS/DEVICES.DAT',0
188
 
189
align 4
190
 
191
shmem_list:
192
 .bk           dd shmem_list
193
 .fd           dd shmem_list
194
 
195
dll_list:
196
 .bk           dd dll_list
197
 .fd           dd dll_list
198
 
199
pcidev_list:
200
 .bk           dd pcidev_list
201
 .fd           dd pcidev_list
202
 
203
MAX_DEFAULT_DLL_ADDR = 0x80000000
204
MIN_DEFAULT_DLL_ADDR = 0x70000000
205
dll_cur_addr   dd MIN_DEFAULT_DLL_ADDR
206
 
207
; supported videomodes
208
 
209
 
210
; mike.dld {
211
;db 0
212
;dd servetable-0x10000
213
;align 4
214
;draw_line       dd __sys_draw_line
215
;draw_pointer    dd __sys_draw_pointer
216
;//mike.dld, 2006-08-02 [
217
;;drawbar         dd __sys_drawbar
218
;;drawbar         dd __sys_drawbar.forced
219
;drawbar         dd vesa20_drawbar
220
;//mike.dld, 2006-08-02 ]
221
;putpixel        dd __sys_putpixel
222
; } mike.dld
223
 
224
 
225
align 4
226
keyboard   dd 1
227
syslang    dd 1
228
 
229
boot_y     dd 10
230
 
231
pci_bios_entry  dd 0
232
                dw pci_code_sel
233
 
234
if __DEBUG__ eq 1
235
  include_debug_strings
236
end if
237
 
238
IncludeIGlobals
239
 
240
align 16
241
gdts:
242
 
243
        dw     gdte-$-1
244
        dd     gdts
245
        dw     0
246
 
247
; Attention! Do not change the order of the first four selectors. They are used in Fast System Call
248
; must be : os_code, os_data, app_code, app_data, ....
249
 
250
int_code_l:
251
os_code_l:
252
        dw     0xffff
253
        dw     0x0000
254
        db     0x00
255
        dw     11011111b *256 +10011010b
256
        db     0x00
257
 
258
int_data_l:
259
os_data_l:
260
        dw     0xffff
261
        dw     0x0000
262
        db     0x00
263
        dw     11011111b *256 +10010010b
264
        db     0x00
265
 
266
app_code_l:
267
        dw 0xFFFF
268
        dw 0
269
        db 0
270
        db cpl3
271
        dw G32+D32+0xF;
272
 
273
app_data_l:
274
        dw 0xFFFF
275
        dw 0
276
        db 0
277
        db drw3
278
        dw G32+D32+0xF;
279
 
280
; ------------- PCI BIOS ------------------
281
 
282
pci_code_32:
283
        dw 0         ;lim  0-15
284
        dw 0         ;base 0-15
285
        db 0         ;base 16-23
286
        db cpl0      ;type
287
        db D32       ;lim 16-19+props
288
        db 0         ;base 24-31
289
 
290
pci_data_32:
291
        dw 0         ;lim  0-15
292
        dw 0         ;base 0-15
293
        db 0         ;base 16-23
294
        db dpl0      ;type
295
        db D32       ;lim 16-19+props
296
        db 0         ;base 24-31
297
 
298
; --------------- APM ---------------------
299
apm_code_32:
300
        dw     0x0f        ; limit 64kb
301
        db     0, 0, 0
302
        dw     11010000b *256 +10011010b
303
        db     0x00
304
apm_code_16:
305
        dw     0x0f
306
        db     0, 0, 0
307
        dw     10010000b *256 +10011010b
308
        db     0x00
309
apm_data_16:
310
        dw     0x0f
311
        db     0, 0, 0
312
        dw     10010000b *256 +10010010b
313
        db     0x00
314
; -----------------------------------------
315
 
316
graph_data_l:
317
 
318
        dw     0x7ff
319
        dw     0x0000
320
        db     0x00
321
        dw     11010000b *256 +11110010b
322
        db     0x00
323
tss0_l:
324
        dw     sizeof.TSS-1
325
        dw     tss and 0xFFFF
326
        db     (tss shr 16) and 0xFF
327
        db     10001001b
328
        dw     (tss shr 16) and 0xFF00
329
 
330
tls_data_l:
331
        dw 0x0FFF
332
        dw 0
333
        db 0
334
        db drw3
335
        dw D32
336
 
337
endofcode:
338
gdte:
339
 
340
diff16 "end of .data segment",0,$
341
 
342
align 16
343
cur_saved_data:
344
                    rb 4096
345
fpu_data:
346
                    rb 512
347
 
348
mem_block_list      rd 64*2
349
mem_used_list       rd 64*2
350
mem_hash_cnt        rd 64
351
 
352
thr_slot_map        rd 8
353
 
354
cpu_freq            rq 1
355
 
356
heap_mutex          MUTEX
357
heap_size           rd 1
358
heap_free           rd 1
359
heap_blocks         rd 1
360
free_blocks         rd 1
361
 
362
mem_block_mask      rd 2
363
next_memblock       rd 1
364
 
365
 
366
mst                 MEM_STATE
367
 
368
page_start          rd 1
369
page_end            rd 1
370
sys_page_map        rd 1
371
os_stack_seg        rd 1
372
 
373
 
374
srv.fd              rd 1
375
srv.bk              rd 1
376
 
377
 
378
align 16
379
 
380
_display            display_t
381
 
382
_WinMapAddress      rd 1
383
_WinMapSize         rd 1
384
 
385
LFBAddress          rd 1
386
Screen_Max_X        rd 1
387
Screen_Max_Y        rd 1
388
 
389
SCR_MODE            rw 2
390
 
391
PUTPIXEL            rd 1
392
GETPIXEL            rd 1
393
 
394
if VESA_1_2_VIDEO
395
BANK_SWITCH         rd 1  reserved for vesa 1.2
396
BANK_RW             rd 1
397
end if
398
 
399
REDRAW_BACKGROUND   rb 4
400
 
401
align 4
402
draw_data:          rb 32*256
403
BPSLine_calc_area   rd 1440
404
d_width_calc_area   rd 1140
405
 
406
mouseunder          rd 16*24
407
 
408
MOUSE_PICTURE       rd 1
409
 
410
MOUSE_SCROLL_H      rw 1
411
MOUSE_X:            rw 1
412
MOUSE_Y:            rw 1
413
MOUSE_SCROLL_V      rw 1
414
 
415
X_UNDER             rw 1
416
Y_UNDER             rw 1
417
COLOR_TEMP          rd 1
418
MOUSE_COLOR_MEM     rd 1
419
 
420
BTN_DOWN:           rb 4
421
 
422
align 4
423
def_cursor          rd 1
424
def_cursor_clock    rd 1
425
current_cursor      rd 1
426
hw_cursor           rd 1
427
cur_saved_base      rd 1
428
 
429
cur.lock            rd 1   ;1 - lock update, 2- hide
430
cur.left            rd 1   ;cursor clip box
431
cur.top             rd 1
432
cur.right           rd 1
433
cur.bottom          rd 1
434
cur.w               rd 1
435
cur.h               rd 1
436
 
437
ipc_tmp             rd 1
438
ipc_pdir            rd 1
439
ipc_ptab            rd 1
440
 
441
proc_mem_map        rd 1
442
proc_mem_pdir       rd 1
443
proc_mem_tab        rd 1
444
 
445
tmp_task_ptab       rd 1
446
 
447
default_io_map      rd 1
448
 
449
LFBSize             rd 1
450
 
4432 Serge 451
current_process     rd 1
452
current_slot        rd 1    ; i.e. cureent thread
4429 Serge 453
 
4432 Serge 454
 
4429 Serge 455
; status
456
hd1_status                      rd 1  ; 0 - free : other - pid
457
application_table_owner         rd 1  ; 0 - free : other - pid
458
application_table_mutex         MUTEX
459
 
460
; device addresses
461
mididp                          rd 1
462
midisp                          rd 1
463
 
464
cdbase                          rd 1
465
cdid                            rd 1
466
 
467
hdbase                          rd 1    ; for boot 0x1f0
468
hdid                            rd 1
469
hdpos                           rd 1    ; for boot 0x1
470
cdpos                           rd 1
471
 
472
;CPUID information
473
cpu_vendor                      rd 3
474
cpu_sign                        rd 1
475
cpu_info                        rd 1
476
cpu_caps                        rd 4
477
 
478
 
479
pg_data                         PG_DATA
480
heap_test                       rd 1
481
 
482
buttontype                      rd 1
483
windowtypechanged               rd 1
484
 
485
hd_entries                      rd 1     ;unused ? 0xfe10
486
 
487
mouse_active                    rd 1
488
mouse_pause                     rd 1
489
 
490
redrawmouse_unconditional       rd 1
491
 
492
img_background                  rd 1
493
mem_BACKGROUND                  rd 1
494
static_background_data          rd 1
495
 
496
BgrDrawMode                     rd 1
497
BgrDataWidth                    rd 1
498
BgrDataHeight                   rd 1
499
 
500
skin_data                       rd 1
501
 
502
debug_step_pointer              rd 1
503
 
504
lba_read_enabled                rd 1  ; 0 = disabled , 1 = enabled
505
pci_access_enabled              rd 1  ; 0 = disabled , 1 = enabled
506
 
4923 Serge 507
cpu_phys_addr_width             rb 1  ; also known as MAXPHYADDR in Intel manuals
4429 Serge 508
hdd_appl_data                   rb 1  ; 0 = system cache, 1 - application cache
509
cd_appl_data                    rb 1  ; 0 = system cache, 1 - application cache
510
 
511
timer_ticks_enable              rb 1  ; for cd driver
512
 
513
align 4
514
NumBiosDisks                    rd 1
515
BiosDisksData                   rb 200h
516
BiosDiskCaches                  rb 80h*(cache_ide1-cache_ide0)
517
BiosDiskPartitions              rd 80h
518
 
519
align 16
520
DRIVE_DATA:                     rb DRIVE_DATA_SIZE
521
 
522
IncludeUGlobals
523
 
524
uglobals_size = $ - endofcode
525
 
526
if ~ lang eq sp
527
diff16 "end of .bss",0,$
528
end if
529
 
530
org (OS_BASE+0x0100000)
531
 
532
RAMDISK:                        rb 2880*512
533
                                rb 2856*4               ; not used
534
 
535
_CLEAN_ZONE:
536
 
537
align 4096
538
_IDE_DMA                        rb 16*512
539
BgrAuxTable                     rb 32768
540
BUTTON_INFO                     rb 64*1024
541
RESERVED_PORTS:                 rb 64*1024
542
FLOPPY_BUFF:                    rb 18*512           ;one track
543
 
544
sys_pgmap:                      rb 1024*1024/8