From 26d6c6af0e157a9d69eae7d836a53f57a9fffd64 Mon Sep 17 00:00:00 2001 From: "Andrey Halyavin (halyavin)" Date: Fri, 26 May 2006 10:48:09 +0000 Subject: [PATCH] Now kernel can be compiled with fasm 1.66. git-svn-id: svn://kolibrios.org@82 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/boot/bootcode.inc | 18 ++++++++++-------- kernel/trunk/boot/bootru.inc | 1 + kernel/trunk/boot/shutdown.inc | 15 +++++++++------ kernel/trunk/kernel.asm | 4 +++- kernel/trunk/kernel16.inc | 1 + kernel/trunk/video/vga.inc | 2 +- 6 files changed, 25 insertions(+), 16 deletions(-) diff --git a/kernel/trunk/boot/bootcode.inc b/kernel/trunk/boot/bootcode.inc index 7f721e8ddc..0f0b6f6ec2 100644 --- a/kernel/trunk/boot/bootcode.inc +++ b/kernel/trunk/boot/bootcode.inc @@ -149,6 +149,7 @@ pagetable_set: ; 16-bit data ; videomodes table + org $+0x10000 gr_table: dw 0x112+0100000000000000b , 640 , 480 ; 1 dw 0x115+0100000000000000b , 800 , 600 ; 2 @@ -173,6 +174,7 @@ gr_table: db 0x00,0x00,0x0,0x00,0x00,0x00,0x0,0x0 db 0x00,0x00,0x0,0x00,0x00,0x00,0x0,0x0 db 0x00,0x00,0x0,0x00,0x00,0x00,0x0,0x0 + org $-0x10000 ;========================================================================= ; @@ -358,14 +360,12 @@ wait_loop: ; variant 2 mov [es : 0x9046], cx ; Save APM flags ; Write APM ver ---- - jmp @f -msg_apm:db ' APM x.x ', 0 -@@: and ax, 0xf0f + and ax, 0xf0f add ax, '00' - mov [msg_apm - 0x10000 + 5], ah - mov [msg_apm - 0x10000 + 7], al - _setcursor 0, 3 mov si, msg_apm - 0x10000 + mov [si + 5], ah + mov [si + 7], al + _setcursor 0, 3 call printplain _setcursor d80x25_top_num,0 ; ------------------ @@ -474,7 +474,7 @@ cfgmanager: ; get start time call .gettime mov [.starttime-0x10000], eax - mov word [.timer-0x10000], .newtimer-0x10000 + mov word [.timer-0x10000], .newtimer mov word [.timer-0x10000+2], cs .printcfg: _setcursor 9,0 @@ -631,7 +631,9 @@ virtual at novesa .bSettingsChanged db ? .timer dd ? end virtual + org $+0x10000 .loader_block dd 0 + org $-0x10000 .gettime: mov ah, 0 int 1Ah @@ -723,7 +725,7 @@ end if mov byte [space_msg-0x10000+80], 186 pop eax push cs - push .cont-0x10000 + push .cont push eax retf .loadc: diff --git a/kernel/trunk/boot/bootru.inc b/kernel/trunk/boot/bootru.inc index 584bf169e3..b5256c93d4 100644 --- a/kernel/trunk/boot/bootru.inc +++ b/kernel/trunk/boot/bootru.inc @@ -55,6 +55,7 @@ d80x25_bottom_num = 3 novesa db "Видеокарта: EGA/CGA",13,10,0 vervesa db "Версия VESA: Vesa x.x",13,10,0 vervesa_off=19 +msg_apm db " APM x.x ", 0 gr_mode db 186," Vesa 2.0+ 16 M LFB: [1] 640x480, [2] 800x600, " db "[3] 1024x768, [4] 1280x1024",13,10 db 186," Vesa 1.2 16 M Bnk: [5] 640x480, [6] 800x600, " diff --git a/kernel/trunk/boot/shutdown.inc b/kernel/trunk/boot/shutdown.inc index 5e4d03a999..072e6e148c 100644 --- a/kernel/trunk/boot/shutdown.inc +++ b/kernel/trunk/boot/shutdown.inc @@ -182,6 +182,7 @@ system_shutdown: ; shut down the system use16 pr_mode_exit: +org $-0x10000 ; setup stack mov ax, 3000h @@ -283,11 +284,12 @@ pr_mode_exit: pause_key_1: loop pause_key_1 ret - +org $+0x10000 old_ints_h: dw 0x400 dd 0 dw 0 +org $-0x10000 rdelay: ret @@ -366,7 +368,7 @@ restart_kernel_4000: ; bootloader interface push 0x1000 pop ds - mov si, .bootloader_block-0x10000 + mov si, .bootloader_block;-0x10000 mov ax, 'KL' jmp 0x1000:0000 @@ -416,8 +418,9 @@ int 0x15 ;!!!!!!!!!!!!!!!!!!!!!!!! fwwritedone: ret - +org $+0x10000 flm db 0 +org $-0x10000 floppy_write: ; write diskette image to physical floppy @@ -478,7 +481,7 @@ floppy_write: ; write diskette image to physical floppy dec ax jnz fwwrites ret - +org $+0x10000 fwmovedesc: db 0x00,0x00,0x0,0x00,0x00,0x00,0x0,0x0 db 0x00,0x00,0x0,0x00,0x00,0x00,0x0,0x0 @@ -488,9 +491,9 @@ floppy_write: ; write diskette image to physical floppy db 0x00,0x00,0x0,0x00,0x00,0x00,0x0,0x0 db 0x00,0x00,0x0,0x00,0x00,0x00,0x0,0x0 db 0x00,0x00,0x0,0x00,0x00,0x00,0x0,0x0 - +org $-0x10000 use32 - +org $+0x10000 uglobal shutdownpos dd 0x0 endg diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index 8efc3abab1..5787fb2555 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -59,10 +59,11 @@ twdw equ (0x3000-window_data) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; use16 - org 0x10000 + org 0x0 jmp start_of_code ; mike.dld { + org $+0x10000 db 0 dd servetable-0x10000 draw_line dd __sys_draw_line @@ -149,6 +150,7 @@ app_data equ 3+app_data_l-gdts and eax, 10011111b *65536*256 + 0xffffff ; caching enabled mov cr0, eax jmp $+2 +org $+0x10000 mov ax,os_data ; Selector for os mov ds,ax mov es,ax diff --git a/kernel/trunk/kernel16.inc b/kernel/trunk/kernel16.inc index 790abd7127..d6a2c77fa0 100644 --- a/kernel/trunk/kernel16.inc +++ b/kernel/trunk/kernel16.inc @@ -23,6 +23,7 @@ include "boot/bootru.inc" ; russian system boot messages ;!!! end if include "boot/ru.inc" ; Russian font +org $-0x10000 include "boot/bootcode.inc" ; 16 bit system boot code diff --git a/kernel/trunk/video/vga.inc b/kernel/trunk/video/vga.inc index e237545bea..c41c17863b 100644 --- a/kernel/trunk/video/vga.inc +++ b/kernel/trunk/video/vga.inc @@ -216,7 +216,7 @@ pimvga: pop ecx dec ebx ; H-- - jnz near pimvga + jnz pimvga add esp,4 ; jump saved limit byte pop edx