kernel constants compression/relocation

git-svn-id: svn://kolibrios.org@1941 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Artem Jerdev (art_zh) 2011-05-30 10:11:03 +00:00
parent e37372cd01
commit 96673e3ce5
12 changed files with 710 additions and 811 deletions

View File

@ -20,7 +20,7 @@ $Revision$
; ;
;========================================================================== ;==========================================================================
if 0
putchar: putchar:
; in: al=character ; in: al=character
mov ah, 0Eh mov ah, 0Eh
@ -61,6 +61,8 @@ macro _setcursor row,column
call setcursor call setcursor
} }
end if
boot_read_floppy: boot_read_floppy:
push si push si
xor si, si xor si, si
@ -78,11 +80,9 @@ boot_read_floppy:
ret ret
sayerr_plain: sayerr_plain:
call printplain
jmp $ jmp $
sayerr: sayerr:
call print
jmp $ jmp $
@ -173,38 +173,6 @@ no_hd_load:
xor di, di xor di, di
mov ah, 1*16+15 mov ah, 1*16+15
; draw top
mov si, d80x25_top
mov cx, d80x25_top_num * 80
@@:
lodsb
stosw
loop @b
; draw spaces
mov si, space_msg
mov dx, 25 - d80x25_top_num - d80x25_bottom_num
dfl1:
push si
mov cx, 80
@@:
lodsb
stosw
loop @b
pop si
dec dx
jnz dfl1
; draw bottom
mov si, d80x25_bottom
mov cx, d80x25_bottom_num * 80
@@:
lodsb
stosw
loop @b
mov byte [space_msg+80], 0 ; now space_msg is null terminated
_setcursor d80x25_top_num,0
cpugood: cpugood:
push 0 push 0
@ -268,16 +236,6 @@ cpugood:
mov [es:0x9044], ax ; Save APM Version mov [es:0x9044], ax ; Save APM Version
mov [es:0x9046], cx ; Save APM flags mov [es:0x9046], cx ; Save APM flags
; Write APM ver ----
and ax, 0xf0f
add ax, '00'
mov si, msg_apm
mov [si + 5], ah
mov [si + 7], al
_setcursor 0, 3
call printplain
; ------------------
mov ax, 0x5304 ; Disconnect interface mov ax, 0x5304 ; Disconnect interface
xor bx, bx xor bx, bx
int 0x15 int 0x15
@ -291,14 +249,12 @@ cpugood:
mov [es:0x9054], dx mov [es:0x9054], dx
apm_end: apm_end:
_setcursor d80x25_top_num, 0
;CHECK current of code ;CHECK current of code
cmp [cfgmanager.loader_block], -1 cmp [cfgmanager.loader_block], -1
jz noloaderblock jz noloaderblock
les bx, [cfgmanager.loader_block] les bx, [cfgmanager.loader_block]
cmp byte [es:bx], 1 cmp byte [es:bx], 1
mov si, loader_block_error
jnz sayerr jnz sayerr
push 0 push 0
pop es pop es
@ -344,22 +300,11 @@ cfgmanager:
cmp byte [di+preboot_biosdisk-preboot_device], 1 cmp byte [di+preboot_biosdisk-preboot_device], 1
adc byte [di+preboot_biosdisk-preboot_device], 0 adc byte [di+preboot_biosdisk-preboot_device], 0
_setcursor 7,0
mov si, space_msg
call printplain
; pop ax ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ?? ; pop ax ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ??
jmp .continue jmp .continue
.loader_block dd -1 .loader_block dd -1
.continue: .continue:
sti sti
_setcursor 6,0
mov si, space_msg
call printplain
call printplain
_setcursor 6,0
mov si, loading_msg
call print
_setcursor 15,0
jmp .load jmp .load
.loadc: .loadc:
@ -367,11 +312,6 @@ cfgmanager:
.cont: .cont:
push cs push cs
pop ds pop ds
mov si, space_msg
mov byte [si+80], 0
_setcursor 15,0
call printplain
_setcursor 15,0
.load: .load:
; ASK GRAPHICS MODE ; ASK GRAPHICS MODE
@ -406,8 +346,6 @@ include 'detect/biosmem.inc'
cmp [boot_dev],0 cmp [boot_dev],0
jne no_sys_on_floppy jne no_sys_on_floppy
mov si,diskload
call print
xor ax, ax ; reset drive xor ax, ax ; reset drive
xor dx, dx xor dx, dx
int 0x13 int 0x13
@ -464,17 +402,8 @@ include 'detect/biosmem.inc'
inc ch inc ch
cmp ch, 80 cmp ch, 80
jae ok_sys_on_floppy jae ok_sys_on_floppy
pusha
mov al, ch mov al, ch
shr ch, 2 shr ch, 2
add al, ch
aam
xchg al, ah
add ax, '00'
mov si, pros
mov [si], ax
call printplain
popa
jmp .a1 jmp .a1
.nocd: .nocd:
; no - read only used sectors from floppy ; no - read only used sectors from floppy
@ -704,11 +633,6 @@ sayerr_floppy:
aam aam
xchg al, ah xchg al, ah
add ax, '00' add ax, '00'
mov si, pros
cmp [si], ax
jz @f
mov [si], ax
call printplain
@@: @@:
popa popa
inc di inc di
@ -717,10 +641,6 @@ sayerr_floppy:
pop bx ; clear stack pop bx ; clear stack
ok_sys_on_floppy: ok_sys_on_floppy:
mov si, backspace2
call printplain
mov si, okt
call printplain
no_sys_on_floppy: no_sys_on_floppy:
xor ax, ax ; reset drive xor ax, ax ; reset drive
xor dx, dx xor dx, dx

View File

@ -14,19 +14,19 @@
$Revision$ $Revision$
d80x25_bottom: ;d80x25_bottom:
db 186,' KolibriOS is based on MenuetOS and comes with ABSOLUTELY ' ; db 186,' KolibriOS is based on MenuetOS and comes with ABSOLUTELY '
db 'NO WARRANTY ',186 ; db 'NO WARRANTY ',186
db 186,' See file COPYING for details ' ; db 186,' See file COPYING for details '
db ' ',186 ; db ' ',186
line_full_bottom ; line_full_bottom
d80x25_bottom_num = 3 ;d80x25_bottom_num = 3
msg_apm db " APM x.x ", 0 ;msg_apm db " APM x.x ", 0
vervesa db "Version of Vesa: Vesa x.x",13,10,0 ;vervesa db "Version of Vesa: Vesa x.x",13,10,0
;novesa db "Display: EGA/CGA",13,10,0 ;novesa db "Display: EGA/CGA",13,10,0
s_vesa db "Version of VESA: " ;s_vesa db "Version of VESA: "
.ver db "?.?",13,10,0 ; .ver db "?.?",13,10,0
;gr_mode db "Select a videomode: ",13,10,0 ;gr_mode db "Select a videomode: ",13,10,0
@ -48,11 +48,11 @@ s_vesa db "Version of VESA: "
;btns db "Fatal - Can't determine color depth.",0 ;btns db "Fatal - Can't determine color depth.",0
;badsect db 13,10,186," Fatal - Bad sector. Replace floppy.",0 ;badsect db 13,10,186," Fatal - Bad sector. Replace floppy.",0
;memmovefailed db 13,10,186," Fatal - Int 0x15 move failed.",0 ;memmovefailed db 13,10,186," Fatal - Int 0x15 move failed.",0
okt db " ... OK" ;okt db " ... OK"
linef db 13,10,0 ;linef db 13,10,0
diskload db "Loading diskette: 00 %",8,8,8,8,0 ;diskload db "Loading diskette: 00 %",8,8,8,8,0
pros db "00" ;pros db "00"
backspace2 db 8,8,0 ;backspace2 db 8,8,0
boot_dev db 0 ; 0=floppy, 1=hd boot_dev db 0 ; 0=floppy, 1=hd
;start_msg db "Press [abcd] to change settings, press [Enter] to continue booting",13,10,0 ;start_msg db "Press [abcd] to change settings, press [Enter] to continue booting",13,10,0
;time_msg db " or wait " ;time_msg db " or wait "
@ -61,6 +61,6 @@ boot_dev db 0 ; 0=floppy, 1=hd
;current_cfg_msg db "cfgmanager.printcfg reached",13,10,0 ;current_cfg_msg db "cfgmanager.printcfg reached",13,10,0
;curvideo_msg db " [a] Videomode: ",0 ;curvideo_msg db " [a] Videomode: ",0
loading_msg db "Loading KolibriOS...",0 ;loading_msg db "Loading KolibriOS...",0
;save_quest db "Remember current settings? [y/n]: ",0 ;save_quest db "Remember current settings? [y/n]: ",0
loader_block_error db "Invalid boot data",0 ;loader_block_error db "Invalid boot data",0

View File

@ -115,7 +115,6 @@ int2strnz:
;------------------------------------------------------- ;-------------------------------------------------------
print_vesa_info: print_vesa_info:
_setcursor 5,2
mov [es:vi.VESASignature],'VBE2' mov [es:vi.VESASignature],'VBE2'
mov ax,0x4F00 mov ax,0x4F00
@ -136,22 +135,6 @@ print_vesa_info:
jb $ jb $
.vesaok2: .vesaok2:
mov ax,[es:vi.VESAVersion]
add ax,'00'
mov [s_vesa.ver], ah
mov [s_vesa.ver+2], al
mov si,s_vesa
call printplain
_setcursor 4,2
mov si,word[es:vi.OemStringPtr]
mov di,si
push ds
mov ds,word[es:vi.OemStringPtr+2]
call printplain
pop ds
ret ret
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
@ -224,6 +207,7 @@ check_first_parm:
test si,si test si,si
jnz .no_zero ;if no zero jnz .no_zero ;if no zero
.zerro: .zerro:
mov word[preboot_graph], ax
mov ax,1024 mov ax,1024
mov bx,768 mov bx,768
@ -295,30 +279,6 @@ check_first_parm:
ret ret
;-----------------------------------------------------------------------------
;Clear area of current video page (0xb800)
;clear_vmodes_table:
; pusha
; draw frames
; push es
; push 0xb800
; pop es
; mov di,1444
; xor ax,ax
; mov ah, 1*16+15
; mov cx,70
; mov bp,12
;.loop_start:
; rep stosw
; mov cx,70
; add di,20
; dec bp
; jns .loop_start
; pop es
; popa
; ret
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
set_vmode: set_vmode:

View File

@ -34,5 +34,5 @@ preboot_biosdisk db 0 ; use V86 to access disks through BIOS (1-yes, 2-no)
if $>0x200 if $>0x200
ERROR: prebooting parameters must fit in first sector!!! ERROR: prebooting parameters must fit in first sector!!!
end if end if
hdsysimage db 'KOLIBRI IMG' ; load from ;hdsysimage db 'KOLIBRI IMG' ; load from
image_save db 'KOLIBRI IMG' ; save to ;image_save db 'KOLIBRI IMG' ; save to

View File

@ -428,6 +428,24 @@ pci_mmio_unmap:
stdcall user_free, ebx stdcall user_free, ebx
ret ret
;------------------------------------------------
align 4
sys_map1:
; copies a block from kernel to user space
; in: esi = address in kernel space
; edi = eddress in user space
; ebx = count (dwords)
; out: nothing
;------------------------------------------------
mov ecx, ebx
pushfd
cld
rep movsd
popfd
ret
;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
uglobal uglobal
align 4 align 4

View File

@ -194,78 +194,74 @@ TASK_BASE equ (OS_BASE+0x0003010)
TASK_DATA equ (OS_BASE+0x0003020) TASK_DATA equ (OS_BASE+0x0003020)
TASK_EVENT equ (OS_BASE+0x0003020) TASK_EVENT equ (OS_BASE+0x0003020)
mouseunder equ (OS_BASE+0x0006900) FLOPPY_BUFF equ (OS_BASE+0x0005000)
CDDataBuf equ (OS_BASE+0x0007000)
FLOPPY_BUFF equ (OS_BASE+0x0008000) idts equ (OS_BASE+0x0007400) ; sys32.inc
;ACTIVE_PROC_STACK equ (OS_BASE+0x000A400) ;unused
idts equ (OS_BASE+0x000B100) mouseunder equ (OS_BASE+0x0007900)
SB16_Status equ (OS_BASE+0x0007F00) ; <<
RAMDISK_FAT equ (OS_BASE+0x0008000)
FLOPPY_FAT equ (OS_BASE+0x000A000) ; fs/fat12.inc
WIN_STACK equ (OS_BASE+0x000C000) WIN_STACK equ (OS_BASE+0x000C000)
WIN_POS equ (OS_BASE+0x000C400) WIN_POS equ (OS_BASE+0x000C400)
FDD_BUFF equ (OS_BASE+0x000D000) FDD_BUFF equ (OS_BASE+0x000D000)
;unused ? only one reference
;ENABLE_TASKSWITCH equ (OS_BASE+0x000E000)
PUTPIXEL equ (OS_BASE+0x000E020) KEY_COUNT equ (OS_BASE+0x000FA00)
GETPIXEL equ (OS_BASE+0x000E024) KEY_BUFF equ (OS_BASE+0x000FA01)
;unused ? only one reference BTN_COUNT equ (OS_BASE+0x000FB00)
; BANK_SWITCH equ (OS_BASE+0x000E030) ; VESA 1.2 - not used BTN_BUFF equ (OS_BASE+0x000FB01)
;unused ? store mousepointer
;MOUSE_PICTURE equ (OS_BASE+0x000F200) ; mousedrv.inc - not used
MOUSE_VISIBLE equ (OS_BASE+0x000F204) ;reserved ? mouse buffer space 0xFC00-FCFF
WIN_TEMP_XY equ (OS_BASE+0x000F300)
KEY_COUNT equ (OS_BASE+0x000F400)
KEY_BUFF equ (OS_BASE+0x000F401)
BTN_COUNT equ (OS_BASE+0x000F500)
BTN_BUFF equ (OS_BASE+0x000F501)
CPU_FREQ equ (OS_BASE+0x000F600)
;unused ? no active references
MOUSE_PORT equ (OS_BASE+0x000F604)
;unused
PS2_CHUNK equ (OS_BASE+0x000FB00)
MOUSE_SCROLL_H equ (OS_BASE+0x000FB08)
MOUSE_X equ (OS_BASE+0x000FB0A)
MOUSE_Y equ (OS_BASE+0x000FB0C)
MOUSE_SCROLL_V equ (OS_BASE+0x000FB0E)
MOUSE_COLOR_MEM equ (OS_BASE+0x000FB10)
COLOR_TEMP equ (OS_BASE+0x000FB30)
BTN_DOWN equ (OS_BASE+0x000FB40)
MOUSE_DOWN equ (OS_BASE+0x000FB44)
X_UNDER equ (OS_BASE+0x000FB4A)
Y_UNDER equ (OS_BASE+0x000FB4C)
ScreenBPP equ (OS_BASE+0x000FBF1)
;unused ? only one reference
MOUSE_BUFF_COUNT equ (OS_BASE+0x000FCFF) MOUSE_BUFF_COUNT equ (OS_BASE+0x000FCFF)
Screen_Max_X equ (OS_BASE+0x000FE00) ;unused ?
Screen_Max_Y equ (OS_BASE+0x000FE04) PS2_CHUNK equ (OS_BASE+0x000FE00)
BytesPerScanLine equ (OS_BASE+0x000FE08) MOUSE_SCROLL_H equ (OS_BASE+0x000FE08)
SCR_MODE equ (OS_BASE+0x000FE0C) MOUSE_X equ (OS_BASE+0x000FE0A)
MOUSE_Y equ (OS_BASE+0x000FE0C)
MOUSE_SCROLL_V equ (OS_BASE+0x000FE0E)
KERNEL_ALLOC_FLAG equ (OS_BASE+0x000FE70) MOUSE_COLOR_MEM equ (OS_BASE+0x000FE10)
mmio_pcie_cfg_addr equ (OS_BASE+0x000FE74) COLOR_TEMP equ (OS_BASE+0x000FE30)
mmio_pcie_cfg_lim equ (OS_BASE+0x000FE78) BTN_DOWN equ (OS_BASE+0x000FE40)
mmio_pcie_cfg_pdes equ (OS_BASE+0x000FE7C) MOUSE_DOWN equ (OS_BASE+0x000FE44)
PCIe_bus_range equ (OS_BASE+0x000FE7E) X_UNDER equ (OS_BASE+0x000FE4A)
Y_UNDER equ (OS_BASE+0x000FE4C)
UserDMAaddr equ (OS_BASE+0x000FE80) PUTPIXEL equ (OS_BASE+0x000FEB8)
LFBAddress equ (OS_BASE+0x000FE84) GETPIXEL equ (OS_BASE+0x000FEBC)
BTN_ADDR equ (OS_BASE+0x000FE88) ScreenBPP equ (OS_BASE+0x000FEC1)
MEM_AMOUNT equ (OS_BASE+0x000FE8C) MOUSE_VISIBLE equ (OS_BASE+0x000FEC4)
WIN_TEMP_XY equ (OS_BASE+0x000FEC8)
CPU_FREQ equ (OS_BASE+0x000FECC)
Screen_Max_X equ (OS_BASE+0x000FED0)
Screen_Max_Y equ (OS_BASE+0x000FED4)
BytesPerScanLine equ (OS_BASE+0x000FED8)
SCR_MODE equ (OS_BASE+0x000FEDC)
KERNEL_ALLOC_FLAG equ (OS_BASE+0x000FEE0)
mmio_pcie_cfg_addr equ (OS_BASE+0x000FEE4)
mmio_pcie_cfg_lim equ (OS_BASE+0x000FEE8)
mmio_pcie_cfg_pdes equ (OS_BASE+0x000FEEC)
PCIe_bus_range equ (OS_BASE+0x000FEEE)
UserDMAaddr equ (OS_BASE+0x000FEF0)
LFBAddress equ (OS_BASE+0x000FEF4)
BTN_ADDR equ (OS_BASE+0x000FEF8)
MEM_AMOUNT equ (OS_BASE+0x000FEFC)
SYS_SHUTDOWN equ (OS_BASE+0x000FF00) SYS_SHUTDOWN equ (OS_BASE+0x000FF00)
TASK_ACTIVATE equ (OS_BASE+0x000FF01) TASK_ACTIVATE equ (OS_BASE+0x000FF01)
BgrDrawMode equ (OS_BASE+0x000FFE4)
BgrDataWidth equ (OS_BASE+0x000FFE8)
BgrDataHeight equ (OS_BASE+0x000FFEC)
REDRAW_BACKGROUND equ (OS_BASE+0x000FFF0) REDRAW_BACKGROUND equ (OS_BASE+0x000FFF0)
BACKGROUND_CHANGED equ (OS_BASE+0x000FFF1) BACKGROUND_CHANGED equ (OS_BASE+0x000FFF1)
BANK_RW equ (OS_BASE+0x000FFF2) BANK_RW equ (OS_BASE+0x000FFF2)
@ -284,45 +280,38 @@ DRIVE_DATA equ (OS_BASE+0x0070000)
SLOT_BASE equ (OS_BASE+0x0080000) SLOT_BASE equ (OS_BASE+0x0080000)
;unused SB16Buffer equ (OS_BASE+0x0090000) ; <<
TMP_BUFF equ (OS_BASE+0x0090000)
VGABasePtr equ (OS_BASE+0x00A0000) VGABasePtr equ (OS_BASE+0x00A0000)
RAMDISK equ (OS_BASE+0x0100000) RAMDISK equ (OS_BASE+0x0100000)
RAMDISK_FAT equ (OS_BASE+0x0280000)
FLOPPY_FAT equ (OS_BASE+0x0282000)
IDE_DMA equ 0x284000 CLEAN_ZONE equ 0x3f0000
BgrAuxTable equ (OS_BASE+0x0298000) IDE_DMA equ 0x03F4000
; unused?
SB16Buffer equ (OS_BASE+0x2A0000)
SB16_Status equ (OS_BASE+0x02B0000)
BUTTON_INFO equ (OS_BASE+0x02C0000) BgrAuxTable equ (OS_BASE+0x0408000)
RESERVED_PORTS equ (OS_BASE+0x02D0000)
IRQ_SAVE equ (OS_BASE+0x02E0000)
BOOT_VAR equ (OS_BASE+0x02f0000)
stack_data_start equ (OS_BASE+0x0300000) BUTTON_INFO equ (OS_BASE+0x0430000)
eth_data_start equ (OS_BASE+0x0300000) RESERVED_PORTS equ (OS_BASE+0x0440000)
stack_data equ (OS_BASE+0x0304000) IRQ_SAVE equ (OS_BASE+0x0450000)
stack_data_end equ (OS_BASE+0x031ffff) BOOT_VAR equ (OS_BASE+0x0460000)
resendQ equ (OS_BASE+0x0320000)
VMODE_BASE equ (OS_BASE+0x0328000)
skin_data equ (OS_BASE+0x0330000)
draw_data equ (OS_BASE+0x0338000);
BgrDrawMode equ (OS_BASE+0x033BFF4) stack_data_start equ (OS_BASE+0x0470000)
BgrDataWidth equ (OS_BASE+0x033BFF8) eth_data_start equ (OS_BASE+0x0470000)
BgrDataHeight equ (OS_BASE+0x033BFFC) stack_data equ (OS_BASE+0x0474000)
stack_data_end equ (OS_BASE+0x048ffff)
resendQ equ (OS_BASE+0x0490000)
VMODE_BASE equ (OS_BASE+0x0498000)
skin_data equ (OS_BASE+0x04A0000)
draw_data equ (OS_BASE+0x04A8000);
sys_pgmap equ (OS_BASE+0x033C000)
UPPER_KERNEL_PAGES equ (OS_BASE+0x0400000) sys_pgmap equ (OS_BASE+0x04B0000) ; <<
virtual at (OS_BASE+0x05FFF80) ;UPPER_KERNEL_PAGES equ (OS_BASE+0x0400000)
virtual at (OS_BASE+0x06FFF80)
tss TSS tss TSS
end virtual end virtual

View File

@ -155,8 +155,8 @@ iglobal
align 4 align 4
servetable3: ; Kolibri-A special service servetable3: ; Kolibri-A special service
dd sys_rdmsr ; 0 dd sys_rdmsr ; 0 = read MSR
dd paleholder ; 1 dd sys_map1 ; 1 = map any page (test only)
dd paleholder ; 2 dd paleholder ; 2
dd sys_end ; last dd sys_end ; last

View File

@ -18,8 +18,8 @@ preinit_mem:
; clear [0x280000..HEAP_BASE] ; clear [0x280000..HEAP_BASE]
xor eax,eax xor eax,eax
mov edi,0x280000 ; 0x280000 = ramdisk FAT ? mov edi, CLEAN_ZONE ; 0x280000 = ramdisk FAT ?
mov ecx,(HEAP_BASE-OS_BASE-0x280000) / 4 mov ecx,(HEAP_BASE-OS_BASE-CLEAN_ZONE) / 4
cld cld
rep stosd rep stosd
@ -35,7 +35,7 @@ preinit_mem:
; save [0..0xffff] ; save [0..0xffff]
xor esi, esi xor esi, esi
mov edi,0x2F0000 ; low mem storage area mov edi,(BOOT_VAR-OS_BASE) ; low mem storage area
mov ecx, 0x10000 / 4 mov ecx, 0x10000 / 4
rep movsd rep movsd
; clear [0x1000..0x0ffff] ; clear [0x1000..0x0ffff]
@ -83,20 +83,24 @@ proc init_mem
mov eax, PG_LARGE+PG_SW mov eax, PG_LARGE+PG_SW
mov cr4, ebx mov cr4, ebx
dec [pg_data.kernel_tables-OS_BASE] dec [pg_data.kernel_tables-OS_BASE]
sub [pg_data.kernel_pages -OS_BASE], 1024 ; 1 large page = 1024 ordinary pages
mov [edx], eax ; map first (physical) 4M bytes mov [edx], eax ; map first (physical) 4M bytes
add edx, 4 add edx, 4
mov edi, [tmp_page_tabs] mov edi, [tmp_page_tabs]
mov ecx, [pg_data.kernel_pages -OS_BASE] ; safety cleaning of already-zeroed space mov ecx, [pg_data.kernel_pages -OS_BASE] ; map the rest of kernel space
xor eax, eax mov eax, 0x00400000+PG_SW
rep stosd .map_kernel_pages:
stosd
add eax, 4096
dec ecx
jnz .map_kernel_pages
mov ecx, [pg_data.kernel_tables-OS_BASE] ; build some PDEs to hold empty PTEs mov ecx, [pg_data.kernel_tables-OS_BASE] ; build some PDEs to hold empty PTEs
mov eax, [tmp_page_tabs] mov eax, [tmp_page_tabs]
or eax, PG_SW or eax, PG_SW
mov edi, edx ; edi = sys_pgdir+0x804 mov edi, edx ; edi = sys_pgdir+0x804
.map_kernel_tabs: .map_kernel_tabs:
stosd stosd
add eax, 0x1000 add eax, 0x1000

View File

@ -118,7 +118,7 @@ use16
version db 'Kolibri OS version 0.7.7.0+ ',13,10,13,10,0 version db 'Kolibri OS version 0.7.7.0+ ',13,10,13,10,0
include "boot/bootstr.inc" ; language-independent boot messages ;include "boot/bootstr.inc" ; language-independent boot messages
include "boot/preboot.inc" include "boot/preboot.inc"
include "boot/booteng.inc" ; english system boot messages include "boot/booteng.inc" ; english system boot messages
@ -559,7 +559,7 @@ include 'detect/disks.inc'
; READ RAMDISK IMAGE FROM HD ; READ RAMDISK IMAGE FROM HD
;!!!!!!!!!!!!!!!!!!!!!!! ;!!!!!!!!!!!!!!!!!!!!!!!
include 'boot/rdload.inc' ;include 'boot/rdload.inc'
;!!!!!!!!!!!!!!!!!!!!!!! ;!!!!!!!!!!!!!!!!!!!!!!!
; mov [dma_hdd],1 ; mov [dma_hdd],1
; CALCULATE FAT CHAIN FOR RAMDISK ; CALCULATE FAT CHAIN FOR RAMDISK
@ -752,11 +752,6 @@ end if
stdcall map_page,tss._io_map_1,\ stdcall map_page,tss._io_map_1,\
[SLOT_BASE+256+APPDATA.io_map+4], PG_MAP [SLOT_BASE+256+APPDATA.io_map+4], PG_MAP
mov ax,[OS_BASE+0x10000+bx_from_load]
cmp ax,'r1' ; if not rused ram disk - load network configuration from files {SPraid.simba}
je no_st_network
call set_network_conf
no_st_network:
call init_userDMA ; <<<<<<<<< ============== core/memory.inc ================= call init_userDMA ; <<<<<<<<< ============== core/memory.inc =================
mov esi, boot_uDMA_ok mov esi, boot_uDMA_ok

View File

@ -64,78 +64,80 @@
; 3c dword cpu usage in cpu timer tics ; 3c dword cpu usage in cpu timer tics
; ;
; ;
; 5000 -> 68FF free (6k6) ; 5000 -> 73FF << FLOPPY buffer (9k) - fs/fat12.inc
; 6900 -> 6EFF saved picture under mouse pointer (1k5)
;
; 6F00 -> 6FFF free (256)
;
; 7000 -> 7FFF unused? CD driver (4k)
;
; 8000 -> A3FF used? FLOPPY driver (4k)
;
; A400 -> B0FF free (3k3), unused ACTIVE_PROC_STACK
; B100 -> B307 IDT for int_0x00..int_0x40 ; 7400 -> 78ff << IDT for int_0x00..int_0x40 + reserv
; B308 -> BFFF free (3k3) ; 7900 -> 7EFF << saved picture under mouse pointer (1k5)
;
; 7F00 -> 7FFF << SB16_Status (256)
;
; XX 8000 -> BFFF free (16k) XX
; 0x80008000 -> 9FFF ramdisk fat (8k)
; 0x8000A000 -> BFFF floppy fat (8k)
; C000 -> C3FF window stack C000 no of windows - all in words ; C000 -> C3FF window stack C000 no of windows - all in words
; C402 -> C7FF window position in stack ; C402 -> C7FF window position in stack
; D000 -> D1FF FDC controller ; D000 -> D1FF FDC controller
; D200 -> D3FF FDC controller for Fat12 ; D200 -> D3FF FDC controller for Fat12
; D400 -> DFFF free (3k) ; D400 -> DFFF free (3k)
; E000 byte multitasking started
; E020 dword putpixel address ; E000 -> F9FF free (6k5)
; E024 dword getpixel address
; E030 dword Vesa 1.2 pm bank switch address ; FA00 byte no of keys in buffer
; E034 -> F1FF free (4k5) ; FA01 byte 'buffer'
; F200 dword mousepicture -pointer ; FA02 -> FAFF reserved for keys
; F204 dword mouse appearance counter
; F208 -> F2FF free (248) ; FB00 byte no of buttons in buffer
; F300 dword x & y temp for windowmove ; FB01 dword 'buffer'
; F304 -> F3FF free (252) ; FB02 -> FBFF reserved for buttons
; F400 byte no of keys in buffer
; F401 byte 'buffer'
; F402 -> F4FF reserved for keys
; F500 byte no of buttons in buffer
; F501 dword 'buffer'
; F502 -> F5FF reserved for buttons
; F600 dword tsc / second
; F604 byte (unused?) mouse port: 1 ps2, 2 com1, 3 com2
; F605 -> FAFF free (1k2)
; FB00 -> FB0F mouse memory 00 chunk count, that includes:
; FB08 word -- mouse H-scroll
; FB0A word -- mouse x
; FB0C word -- mouse y
; FB0E word -- mouse V-scroll
; FB10 -> FB17 mouse color mem
; FB21 x move
; FB22 y move
; FB28 high bits temp
; FB30 color temp
; FB40 byte buttons down
; FB44 byte 0 mouse down -> do not draw
; FB4A -> FB4D FB4A-B x-under - FB4C-D y-under
; FBF1 byte bits per pixel
; FC00 -> FCFE com1/ps2 buffer ; FC00 -> FCFE com1/ps2 buffer
; FCFF com1/ps2 buffer count starting from FC00 ; FCFF com1/ps2 buffer count starting from FC00
; FD00 -> FDFF free (256) ; FD00 -> FDFF free (256)
; FE00 dword screen x size
; FE04 dword screen y size ; FE00 -> FE0F mouse memory 00 chunk count, that includes:
; FE08 dword screen y multiplier ; FE08 word -- mouse H-scroll
; FE0C dword screen mode ; FE0A word -- mouse x
; FE10 -> FE73 free (100) ; FE0C word -- mouse y
; FE74 dword PCIe extended (memory-mappable) config space - physical address ; FE0E word -- mouse V-scroll
; FE78 dword PCIe extended config space limit
; FE7C word number of 4M-pages needed to map PCIe config space ; FE10 -> FB17 mouse color mem
; FE7E word PCIe bus range (power-ow-two Mbytes) ; FE21 x move
; FE80 dword physical address of user-accessible static system buffer ; FE22 y move
; FE84 dword physical address of LFB ; FE28 high bits temp
; FE88 dword address of button list ; FE30 color temp
; FE8C dword memory to use ; FE40 byte buttons down
; FE90 -> FEFF free (112) ; FE44 byte 0 mouse down -> do not draw
; FE4A -> FE4D FE4A-B x-under - FE4C-D y-under
; FEB8 dword putpixel address
; FEBC dword getpixel address
; FEC1 byte bits per pixel
; FEC4 dword mouse appearance counter
; FEC8 dword x & y temp for windowmove
; FECC dword tsc / second
; FED0 dword screen x size
; FED4 dword screen y size
; FED8 dword screen y multiplier
; FEDC dword screen mode
; FEE4 dword PCIe extended (memory-mappable) config space - physical address
; FEE8 dword PCIe extended config space limit
; FEEC word number of 4M-pages needed to map PCIe config space
; FEEE word PCIe bus range (power-ow-two Mbytes)
; FEF0 dword physical address of user-accessible static system buffer
; FEF4 dword physical address of LFB
; FEF8 dword address of button list
; FEFC dword memory to use
; FF00 byte 1 = system shutdown request ; FF00 byte 1 = system shutdown request
; FF01 byte task activation request? ; FF01 byte task activation request?
; FFE4 -> FFEF background info
; FFF0 byte >0 if redraw background request from app ; FFF0 byte >0 if redraw background request from app
; FFF1 byte >0 if background changed ; FFF1 byte >0 if background changed
; FFF2 write and read bank in screen ; FFF2 write and read bank in screen
@ -143,7 +145,7 @@
; FFF5 byte 1 do not draw pointer ; FFF5 byte 1 do not draw pointer
; FFFF byte do not change task for 1/100 sec. ; FFFF byte do not change task for 1/100 sec.
; ;
; 0x80010000 -> 6CBFF kernel, 32-bit run-time code (up to 371 Kb) ; 0x80010000 -> 6CBFF the kernel (up to 371 Kb)
; in the current version: ; in the current version:
; -> 00B3C 16-bit code end ; -> 00B3C 16-bit code end
; -> 00C40 16-bit data end ; -> 00C40 16-bit data end
@ -203,23 +205,29 @@
; BC dword address of debug event memory ; BC dword address of debug event memory
; C0 5 dd thread debug registers: DR0,DR1,DR2,DR3,DR7 ; C0 5 dd thread debug registers: DR0,DR1,DR2,DR3,DR7
; ;
; 0x80090000 -> 9FFFF tmp (64k) - unused? ; 0x80090000 -> 9FFFF wav device buffer (64k) ; << SB16Buffer
; 0x800A0000 -> AFFFF screen access area ; 0x800A0000 -> AFFFF screen access area << VGA legacy buffer
; 0x800B0000 -> FFFFF bios rest in peace -area (320k) ? ; 0x800B0000 -> FFFFF bios rest in peace -area (320k), << purpose unknown
; 0x80100000 -> 27FFFF diskette image (1m5) ; 0x80100000 -> 283FFF diskette image (1m5)
; 0x80280000 -> HEAP_BASE zero-filled zone after preinit_mem ; 0x80284000 -> HEAP_BASE zero-filled zone after preinit_mem
; 0x80280000 -> 281FFF ramdisk fat (8k)
; 0x80282000 -> 283FFF floppy fat (8k)
; ;
; 0x80284000 -> 28BFFF HDD DMA AREA (32k) ; 0x80284000 -> 28BFFF HDD DMA AREA (32k)
; 0x8028C000 -> 297FFF free (48k) ; 0x8028C000 -> 297FFF free (48k)
; ;
; 0x80298000 -> 29ffff auxiliary table for background smoothing code (32k) ; 0x80298000 -> 29ffff auxiliary table for background smoothing code (32k)
; ;
; 0x802A0000 -> 2B00ff wav device buffer (64k) ; 0x802A0000 -> 2Bffff free (128k)
; 0x802A0000 -> 2B00ff wav device status (256) ; 0x80328000 -> 32FFFF !vrr driver (32k)
; 0x802B0100 -> 2Bffff free (63k8)
; 0x80338000 -> 338FFF draw data - 256 entries (4k)
; 00 dword draw limit - x start
; 04 dword draw limit - y start
; 08 dword draw limit - x end
; 0C dword draw limit - y end
; 0x80339000 -> 3BFFF3 free (12k)
; 0x802C0000 -> 2C3fff button info (8k) ; 0x802C0000 -> 2C3fff button info (8k)
; ;
; 0000 word number of buttons ; 0000 word number of buttons
@ -242,25 +250,16 @@
; dword end port ; dword end port
; dword 0 ; dword 0
; ;
; 0x802E0000 -> 2EFFFF irq data area (64k) ; 0x80370000 -> 37FFFF irq data area (64k)
; 0x802F0000 -> 2FFFFF low memory save (64k) ; 0x80380000 -> 38FFFF low memory save (64k)
; ;
; 0x80300000 -> 31FFFF tcp memory (128k) ; 0x80390000 -> 3AFFFF tcp memory (128k)
; 0x80320000 -> 327FFF tcp memory (32k) ; 0x803B0000 -> 3B7FFF tcp memory (32k)
;
; 0x80328000 -> 32FFFF !vrr driver (32k)
; 0x80330000 -> 377FFF skin data (32k) ; 0x803B8000 -> 3BFFFF skin data (32k)
; 0x80338000 -> 338FFF draw data - 256 entries (4k) ; 0x803C0000 page map (length b = memsize shr 15)
; 00 dword draw limit - x start ; 0x803C0000 + b start of static pagetables
; 04 dword draw limit - y start
; 08 dword draw limit - x end
; 0C dword draw limit - y end
; 0x80339000 -> 3BFFF3 free (12k)
; 0x8033BFF4 -> 33BFFF background info
; 0x8033C000 page map (length b = memsize shr 15)
; 0x8033C000 + b start of static pagetables
; 0x803FFFFF <- no direct address translation beyond this point ; 0x803FFFFF <- no direct address translation beyond this point
; ============================================================= ; =============================================================

View File

@ -286,6 +286,7 @@ RAMDISK equ (OS_BASE+0x0100000)
RAMDISK_FAT equ (OS_BASE+0x0280000) RAMDISK_FAT equ (OS_BASE+0x0280000)
FLOPPY_FAT equ (OS_BASE+0x0282000) FLOPPY_FAT equ (OS_BASE+0x0282000)
CLEAN_ZONE equ 0x284000
IDE_DMA equ 0x284000 IDE_DMA equ 0x284000
BgrAuxTable equ (OS_BASE+0x0298000) BgrAuxTable equ (OS_BASE+0x0298000)
@ -311,7 +312,9 @@ BgrDrawMode equ (OS_BASE+0x033BFF4)
BgrDataWidth equ (OS_BASE+0x033BFF8) BgrDataWidth equ (OS_BASE+0x033BFF8)
BgrDataHeight equ (OS_BASE+0x033BFFC) BgrDataHeight equ (OS_BASE+0x033BFFC)
sys_pgmap equ (OS_BASE+0x033C000) BOOT_VAR equ (OS_BASE+0x0340000)
sys_pgmap equ (OS_BASE+0x0350000)
UPPER_KERNEL_PAGES equ (OS_BASE+0x0400000) UPPER_KERNEL_PAGES equ (OS_BASE+0x0400000)

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2010. All rights reserved. ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved.
;; PROGRAMMING: ;; PROGRAMMING:
;; Ivan Poddubny ;; Ivan Poddubny
;; Marat Zakiyanov (Mario79) ;; Marat Zakiyanov (Mario79)
@ -19,6 +19,17 @@
;; SPraid (simba) ;; SPraid (simba)
;; Hidnplayr ;; Hidnplayr
;; Alexey Teplov (<Lrz>) ;; Alexey Teplov (<Lrz>)
;; Rus
;; Nable
;; shurf
;; Alver
;; Maxis
;; Galkov
;; CleverMouse
;; tsdima
;; turbanoff
;; Asper
;; art_zh
;; ;;
;; Data in this file was originally part of MenuetOS project which is ;; Data in this file was originally part of MenuetOS project which is
;; distributed under the terms of GNU GPL. It is modified and redistributed as ;; distributed under the terms of GNU GPL. It is modified and redistributed as
@ -220,8 +231,8 @@ B32:
; CLEAR 0x280000 - HEAP_BASE ; CLEAR 0x280000 - HEAP_BASE
xor eax,eax xor eax,eax
mov edi,0x280000 mov edi,CLEAN_ZONE
mov ecx,(HEAP_BASE-OS_BASE-0x280000) / 4 mov ecx,(HEAP_BASE-OS_BASE-CLEAN_ZONE) / 4
cld cld
rep stosd rep stosd
@ -237,7 +248,7 @@ B32:
; SAVE & CLEAR 0-0xffff ; SAVE & CLEAR 0-0xffff
xor esi, esi xor esi, esi
mov edi,0x2F0000 mov edi,(BOOT_VAR-OS_BASE)
mov ecx,0x10000 / 4 mov ecx,0x10000 / 4
rep movsd rep movsd
mov edi,0x1000 mov edi,0x1000