Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 183 → Rev 181

/kernel/trunk/unpacker.inc
File deleted
Property changes:
Deleted: svn:executable
-*
\ No newline at end of property
/kernel/trunk/core/sys32.inc
7,6 → 7,80
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
align 32
 
; GDT TABLE
 
gdts:
 
dw gdte-$-1
dd gdts
dw 0
 
int_code_l:
os_code_l:
 
dw 0xffff
dw 0x0000
db 0x00
dw 11011111b *256 +10011010b
db 0x00
 
int_data_l:
os_data_l:
 
dw 0xffff
dw 0x0000
db 0x00
dw 11011111b *256 +10010010b
db 0x00
 
; --------------- APM ---------------------
apm_code_32:
dw 0x10 ; limit 64kb
db 0, 0, 0
dw 11011111b *256 +10011010b
db 0x00
apm_code_16:
dw 0x10
db 0, 0, 0
dw 10011111b *256 +10011010b
db 0x00
apm_data_16:
dw 0x10
db 0, 0, 0
dw 10011111b *256 +10010010b
db 0x00
; -----------------------------------------
 
app_code_l:
dw 0xFFFF;((0x80000000-std_application_base_address) shr 12) and 0xffff
dw 0
db 0x40
db cpl3
dw G32+D32+0x6000+0x7;
 
app_data_l:
dw 0xFFFF;(0x80000000-std_application_base_address) shr 12 and 0xffff
dw 0
db 0x40
db drw3
dw G32+D32+0x6000+0x7;
 
graph_data_l:
 
dw 0x3ff
dw 0x0000
db 0x00
dw 11010000b *256 +11110010b
db 0x00
 
tss0_l:
times (max_processes+10) dd 0,0
 
gdte:
 
 
idtreg:
dw 8*0x41-1
dd idts+8
13,6 → 87,7
;label idts at 0xB100-8
 
 
 
uglobal
tss_sceleton:
l.back dw 0,0
/kernel/trunk/kernel.asm
162,14 → 162,8
mov esp,0x3ec00 ; Set stack
jmp pword os_code:B32 ; jmp to enable 32 bit mode
 
if gdte >= $
error 'GDT overlaps with used code!'
end if
 
use32
 
include 'unpacker.inc'
 
iglobal
boot_memdetect db 'Determining amount of memory',0
boot_fonts db 'Fonts loaded',0
/kernel/trunk/boot/bootcode.inc
15,119 → 15,6
;
;==========================================================================
 
; 16-bit data
org $+0x10000
 
old_ints_h:
dw 0x400
dd 0
dw 0
 
kernel_restart_bootblock:
db 1 ; version
dw 1 ; floppy image is in memory
dd 0 ; cannot save parameters
 
 
align 32
 
; GDT TABLE
 
gdts:
 
dw gdte-$-1
dd gdts
dw 0
 
int_code_l:
os_code_l:
 
dw 0xffff
dw 0x0000
db 0x00
dw 11011111b *256 +10011010b
db 0x00
 
int_data_l:
os_data_l:
 
dw 0xffff
dw 0x0000
db 0x00
dw 11011111b *256 +10010010b
db 0x00
 
; --------------- APM ---------------------
apm_code_32:
dw 0x10 ; limit 64kb
db 0, 0, 0
dw 11011111b *256 +10011010b
db 0x00
apm_code_16:
dw 0x10
db 0, 0, 0
dw 10011111b *256 +10011010b
db 0x00
apm_data_16:
dw 0x10
db 0, 0, 0
dw 10011111b *256 +10010010b
db 0x00
; -----------------------------------------
 
app_code_l:
dw 0xFFFF;((0x80000000-std_application_base_address) shr 12) and 0xffff
dw 0
db 0x40
db cpl3
dw G32+D32+0x6000+0x7;
 
app_data_l:
dw 0xFFFF;(0x80000000-std_application_base_address) shr 12 and 0xffff
dw 0
db 0x40
db drw3
dw G32+D32+0x6000+0x7;
 
graph_data_l:
 
dw 0x3ff
dw 0x0000
db 0x00
dw 11010000b *256 +11110010b
db 0x00
 
tss0_l:
; times (max_processes+10) dd 0,0
gdte = $ + (max_processes+10)*8
 
; videomodes table
gr_table:
dw 0x112+0100000000000000b , 640 , 480 ; 1
dw 0x115+0100000000000000b , 800 , 600 ; 2
dw 0x118+0100000000000000b , 1024 , 768 ; 3
dw 0x11B+0100000000000000b , 1280 , 1024 ; 4
dw 0x112 , 640 , 480 ; 5
dw 0x115 , 800 , 600 ; 6
dw 0x118 , 1024 , 768 ; 7
dw 0x11B , 1280 ,1024 ; 8
dw 0x13, 640, 480 ; 9
dw 0x12, 640, 480 ; 0
 
; table for move to extended memory (int 15h, ah=87h)
movedesc:
db 0x00,0x00,0x0,0x00,0x00,0x00,0x0,0x0
db 0x00,0x00,0x0,0x00,0x00,0x00,0x0,0x0
 
db 0xff,0xff,0x0,0xa0,0x00,0x93,0x0,0x0
db 0xff,0xff,0x0,0x00,0x10,0x93,0x0,0x0
 
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
db 0x00,0x00,0x0,0x00,0x00,0x00,0x0,0x0
org $-0x10000
 
putchar:
; in: al=character
mov ah, 0Eh
252,16 → 139,16
call setcursor
}
 
;pagetable_set:
pagetable_set:
;eax - physical address
;es:di - page table
;ecx - number of pages to map
; or al, 7
;@@:
; stosd
; add eax, 1000h
; loop @b
; ret
or al, 7
@@:
stosd
add eax, 1000h
loop @b
ret
 
boot_read_floppy:
push si
283,6 → 170,35
pop si
ret
 
; 16-bit data
; videomodes table
org $+0x10000
gr_table:
dw 0x112+0100000000000000b , 640 , 480 ; 1
dw 0x115+0100000000000000b , 800 , 600 ; 2
dw 0x118+0100000000000000b , 1024 , 768 ; 3
dw 0x11B+0100000000000000b , 1280 , 1024 ; 4
dw 0x112 , 640 , 480 ; 5
dw 0x115 , 800 , 600 ; 6
dw 0x118 , 1024 , 768 ; 7
dw 0x11B , 1280 ,1024 ; 8
dw 0x13, 640, 480 ; 9
dw 0x12, 640, 480 ; 0
 
; table for move to extended memory (int 15h, ah=87h)
movedesc:
db 0x00,0x00,0x0,0x00,0x00,0x00,0x0,0x0
db 0x00,0x00,0x0,0x00,0x00,0x00,0x0,0x0
 
db 0xff,0xff,0x0,0xa0,0x00,0x93,0x0,0x0
db 0xff,0xff,0x0,0x00,0x10,0x93,0x0,0x0
 
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
db 0x00,0x00,0x0,0x00,0x00,0x00,0x0,0x0
org $-0x10000
 
;=========================================================================
;
; 16 BIT CODE
/kernel/trunk/boot/shutdown.inc
287,6 → 287,12
pause_key_1:
loop pause_key_1
ret
org $+0x10000
old_ints_h:
dw 0x400
dd 0
dw 0
org $-0x10000
 
rdelay:
ret
365,10 → 371,15
; bootloader interface
push 0x1000
pop ds
mov si, kernel_restart_bootblock-0x10000
mov si, .bootloader_block;-0x10000
mov ax, 'KL'
jmp 0x1000:0000
 
.bootloader_block:
db 1 ; version
dw 1 ; floppy image is in memory
dd 0 ; cannot save parameters
 
APM_PowerOff:
mov ax, 5304h
xor bx, bx