/kernel/trunk/blkdev/fdc.inc |
---|
9,7 → 9,7 |
endg |
fdc_init: ;start with clean tracks. |
mov edi,0xD201 |
mov edi,OS_BASE+0xD201 |
mov al,0 |
mov ecx,160 |
rep stosb |
22,7 → 22,7 |
mov bl,18 |
div bl |
mov ah,0 |
add eax,0xD201 |
add eax,OS_BASE+0xD201 |
mov [eax],byte 1 ;This track is now dirty. |
popa |
ret |
/kernel/trunk/blkdev/hd_drv.inc |
---|
25,7 → 25,7 |
push ecx esi edi ; scan cache |
mov ecx,cache_max ; entries in cache |
mov esi,0x600000+8 |
mov esi,OS_BASE+0x600000+8 |
mov edi,1 |
hdreadcache: |
54,7 → 54,7 |
call hd_read_pio |
@@: |
lea esi,[edi*8+0x600000] |
lea esi,[edi*8+OS_BASE+0x600000] |
mov [esi],eax ; sector number |
mov dword [esi+4],1 ; hd read - mark as same as in hd |
62,7 → 62,7 |
mov esi,edi |
shl esi,9 |
add esi,0x600000+65536 |
add esi,OS_BASE+0x600000+65536 |
mov edi,ebx |
mov ecx,512/4 |
cld |
115,7 → 115,7 |
cli |
push edi |
shl edi,9 |
add edi,0x600000+65536 |
add edi,OS_BASE+0x600000+65536 |
mov ecx,256 |
mov edx,[hdbase] |
cld |
153,7 → 153,7 |
; check if the cache already has the sector and overwrite it |
mov ecx,cache_max |
mov esi,0x600000+8 |
mov esi,OS_BASE+0x600000+8 |
mov edi,1 |
hdwritecache: |
178,7 → 178,7 |
cmp [hd_error],0 |
jne hd_write_access_denied |
lea esi,[edi*8+0x600000] |
lea esi,[edi*8+OS_BASE+0x600000] |
mov [esi],eax ; sector number |
yes_in_cache_write: |
186,7 → 186,7 |
mov dword [esi+4],2 ; write - differs from hd |
shl edi,9 |
add edi,0x600000+65536 |
add edi,OS_BASE+0x600000+65536 |
mov esi,ebx |
mov ecx,512/4 |
cld |
205,7 → 205,7 |
; write difference ( 2 ) from cache to hd |
mov ecx,cache_max |
mov esi,0x600000+8 |
mov esi,OS_BASE+0x600000+8 |
mov edi,1 |
write_cache_more: |
323,7 → 323,7 |
; cli |
mov esi,edi |
shl esi,9 |
add esi,0x600000+65536 ; esi = from memory position |
add esi,OS_BASE+0x600000+65536 ; esi = from memory position |
mov ecx,256 |
mov edx,[hdbase] |
cld |
357,7 → 357,7 |
inside_cache: |
cmp dword [edi*8+0x600000+4],2 ; get cache slot info |
cmp dword [edi*8+OS_BASE+0x600000+4],2 ; get cache slot info |
jb found_slot ; it's empty or read |
dec ecx |
jnz search_for_empty |
378,7 → 378,7 |
clear_hd_cache: |
push eax ecx edi |
mov edi,0x600000 |
mov edi,OS_BASE+0x600000 |
mov ecx,16384 |
xor eax,eax |
cld |
574,7 → 574,7 |
align 4 |
; note that IDE descriptor table must be 4-byte aligned and do not cross 4K boundary |
IDE_descriptor_table: |
dd 284000h |
dd OS_BASE+284000h |
dw 2000h |
dw 8000h |
607,16 → 607,16 |
out dx, al |
call update_counters |
mov ebx, [dma_process] |
cmp [0x3000], ebx |
cmp [CURRENT_TASK], ebx |
jz .noswitch |
mov [dma_task_switched], 1 |
mov edi, [dma_slot_ptr] |
mov eax, [0x3000] |
mov eax, [CURRENT_TASK] |
mov [dma_process], eax |
mov eax, [0x3010] |
mov eax, [TASK_BASE] |
mov [dma_slot_ptr], eax |
mov [0x3000], ebx |
mov [0x3010], edi |
mov [CURRENT_TASK], ebx |
mov [TASK_BASE], edi |
mov byte [0xFFFF], 1 |
call do_change_task |
.noswitch: |
638,16 → 638,16 |
out dx, al |
call update_counters |
mov ebx, [dma_process] |
cmp [0x3000], ebx |
cmp [CURRENT_TASK], ebx |
jz .noswitch |
mov [dma_task_switched], 1 |
mov edi, [dma_slot_ptr] |
mov eax, [0x3000] |
mov eax, [CURRENT_TASK] |
mov [dma_process], eax |
mov eax, [0x3010] |
mov eax, [TASK_BASE] |
mov [dma_slot_ptr], eax |
mov [0x3000], ebx |
mov [0x3010], edi |
mov [CURRENT_TASK], ebx |
mov [TASK_BASE], edi |
mov byte [0xFFFF], 1 |
call do_change_task |
.noswitch: |
668,11 → 668,11 |
mov eax, [esp+4] |
sub eax, [dma_cur_sector] |
shl eax, 9 |
add eax, 0x284000 |
add eax, OS_BASE+0x284000 |
push ecx esi edi |
mov esi, eax |
shl edi, 9 |
add edi, 0x610000 |
add edi, OS_BASE+0x610000 |
mov ecx, 512/4 |
cld |
rep movsd |
681,9 → 681,9 |
pop eax |
ret |
.notread: |
mov eax, IDE_descriptor_table |
mov dword [eax], 0x284000 |
mov word [eax+4], 0x2000 |
mov eax, IDE_descriptor_table-OS_BASE |
mov dword [eax+OS_BASE], 0x284000 |
mov word [eax+4+OS_BASE], 0x2000 |
mov dx, [IDEContrRegsBaseAddr] |
cmp [hdbase], 0x1F0 |
jz @f |
734,9 → 734,9 |
@@: |
mov al, 9 |
out dx, al |
mov eax, [0x3000] |
mov eax, [CURRENT_TASK] |
mov [dma_process], eax |
mov eax, [0x3010] |
mov eax, [TASK_BASE] |
mov [dma_slot_ptr], eax |
cmp [hdbase], 0x1F0 |
jnz .ide1 |
766,7 → 766,7 |
mov eax, IDE_descriptor_table |
mov edx, [cache_chain_pos] |
shl edx, 9 |
add edx, 0x610000 |
add edx, OS_BASE+0x610000 |
mov [eax], edx |
movzx edx, [cache_chain_size] |
shl edx, 9 |
777,7 → 777,7 |
mov eax, IDE_descriptor_table |
mov edx, edi |
shl edx, 9 |
add edx, 0x610000 |
add edx, OS_BASE+0x610000 |
mov [eax], edx |
mov word [eax+4], 0x200 |
do_write_dma: |
832,9 → 832,9 |
@@: |
mov al, 1 |
out dx, al |
mov eax, [0x3000] |
mov eax, [CURRENT_TASK] |
mov [dma_process], eax |
mov eax, [0x3010] |
mov eax, [TASK_BASE] |
mov [dma_slot_ptr], eax |
cmp [hdbase], 0x1F0 |
jnz .ide1 |
/kernel/trunk/core/memory.inc |
---|
424,12 → 424,11 |
.map_page_tables: |
@@: |
call alloc_page |
stdcall map_page_table, edx, eax |
add esi, 0x00400000 |
add edx, 0x00400000 |
dec edi |
jnz @B |
jnz .map_page_tables |
mov eax, [LFBAddress] |
mov edi, page_tabs + (LFB_BASE shr 10) |
436,7 → 435,11 |
or eax, PG_UW |
mov ecx, [pg_count] |
cld |
rep stosd |
@@: |
stosd |
add eax, 0x1000 |
dec ecx |
jnz @B |
mov dword [LFBAddress], LFB_BASE |
mov eax, cr3 ;flush TLB |
/kernel/trunk/core/sys32.inc |
---|
7,6 → 7,7 |
;; ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
align 4 |
idtreg: |
dw 8*0x41-1 |
dd idts+8 |
/kernel/trunk/detect/dev_hdcd.inc |
---|
12,24 → 12,24 |
mov [DiskNumber],0 |
call FindHDD_3 |
; mov ax,[Sector512+176] |
; mov [0x40006],ax |
; mov [DRIVE_DATA+6],ax |
; mov ax,[Sector512+126] |
; mov [0x40008],ax |
; mov [DRIVE_DATA+8],ax |
; mov ax,[Sector512+128] |
; mov [0x40008],ax |
; mov [DRIVE_DATA+8],ax |
mov [DiskNumber],1 |
call FindHDD_3 |
; mov al,[Sector512+176] |
; mov [0x40007],al |
; mov [DRIVE_DATA+7],al |
inc [ChannelNumber] |
mov [DiskNumber],0 |
call FindHDD_3 |
; mov al,[Sector512+176] |
; mov [0x40008],al |
; mov [DRIVE_DATA+8],al |
mov [DiskNumber],1 |
call FindHDD_1 |
; mov al,[Sector512+176] |
; mov [0x40009],al |
; mov [DRIVE_DATA+9],al |
jmp EndFindHDD |
41,7 → 41,7 |
ja FindHDD_2 |
cmp [Sector512+12],word 255 |
ja FindHDD_2 |
inc byte [0x40001] |
inc byte [DRIVE_DATA+1] |
jmp FindHDD_2_2 |
FindHDD_2: |
call DeviceReset |
50,14 → 50,14 |
call ReadCD_ID |
cmp [DevErrorCode],0 |
jne FindHDD_2_2 |
inc byte [0x40001] |
inc byte [0x40001] |
inc byte [DRIVE_DATA+1] |
inc byte [DRIVE_DATA+1] |
FindHDD_2_2: |
ret |
FindHDD_3: |
call FindHDD_1 |
shl byte [0x40001],2 |
shl byte [DRIVE_DATA+1],2 |
ret |
84,7 → 84,7 |
cmp [DevErrorCode],0 ;ïðîâåðèòü êîä îøèáêè |
jne @@End ;çàêîí÷èòü, ñîõðàíèâ êîä îøèáêè |
mov DX,[ATABasePortAddr] |
add DX,7 ;àäðåñ ðåãèñòðà ñîñòîÿíèÿ |
add DX,7 ;àäðåñ ðåãèñòðà ñîñòîÿíè |
mov ecx,0xffff |
@@WaitCompleet: |
; Ïðîâåðèòü âðåìÿ âûïîëíåíèÿ êîìàíäû |
191,7 → 191,7 |
; mov eax,[timer_ticks] |
; mov [TickCounter_1],eax |
@@WaitHDReady: |
; Ïðîâåðèòü âðåìÿ îæèäàíèÿ |
; Ïðîâåðèòü âðåìÿ îæèäàíè |
dec ecx |
cmp ecx,0 |
je @@Err1 |
199,7 → 199,7 |
; sub eax,[TickCounter_1] |
; cmp eax,300 ;îæèäàòü 300 òèêîâ |
; ja @@Err1 ;îøèáêà òàéì-àóòà |
; Ïðî÷èòàòü ðåãèñòð ñîñòîÿíèÿ |
; Ïðî÷èòàòü ðåãèñòð ñîñòîÿíè |
in AL,DX |
; Ïðîâåðèòü ñîñòîÿíèå ñèãíàëà BSY |
test AL,80h |
285,7 → 285,7 |
add DX,7 ;ïîðò 1õ7h |
mov ecx,0xffff |
@@WaitCompleet_1: |
; Ïðîâåðèòü âðåìÿ |
; Ïðîâåðèòü âðåì |
dec ecx |
cmp ecx,0 |
je @@Error1_1 ;îøèáêà òàéì-àóòà |
348,11 → 348,11 |
out DX,AL |
mov ecx,0x80000 |
@@WaitHDReady_1: |
; Ïðîâåðèòü âðåìÿ îæèäàíèÿ |
; Ïðîâåðèòü âðåìÿ îæèäàíè |
dec ecx |
cmp ecx,0 |
je @@Err1_2 ;îøèáêà òàéì-àóòà |
; Ïðî÷èòàòü ðåãèñòð ñîñòîÿíèÿ |
; Ïðî÷èòàòü ðåãèñòð ñîñòîÿíè |
in AL,DX |
; Ïðîâåðèòü ñîñòîÿíèå ñèãíàëà BSY |
test AL,80h |
/kernel/trunk/fs/fs.inc |
---|
389,8 → 389,8 |
choice_necessity_partition_1: |
mov ecx,[hdpos] |
xor eax,eax |
mov [0xfe10], eax ; entries in hd cache |
mov edx,0x40002 |
mov [hd_entries], eax ; entries in hd cache |
mov edx,DRIVE_DATA+2 |
search_partition_array: |
mov bl,[edx] |
movzx ebx,bl |
402,7 → 402,7 |
dec eax |
xor edx,edx |
imul eax,100 |
add eax,0x4000a |
add eax,DRIVE_DATA+0xa |
mov [transfer_adress],eax |
call partition_data_transfer_1 |
ret |
/kernel/trunk/fs/fs_lfn.inc |
---|
427,7 → 427,7 |
mov [hdpos], eax |
cmp ecx, 0x100 |
jae .nf |
cmp cl, [0x40001+eax] |
cmp cl, [DRIVE_DATA+eax] |
jbe @f |
.nf: |
call free_hd_channel |
503,7 → 503,7 |
jae .nf |
push ecx ebx |
mov cl,al |
mov bl,[0x40001] |
mov bl,[DRIVE_DATA+1] |
shr bl,cl |
test bl,2 |
pop ebx ecx |
/kernel/trunk/gui/window.inc |
---|
516,7 → 516,7 |
repos_windows: |
mov ecx,[TASK_COUNT] |
mov edi,0x20*2 |
mov edi, OS_BASE+0x20*2 |
mov byte[REDRAW_BACKGROUND],1 |
dec ecx |
jge @f |
537,6 → 537,7 |
neg eax |
mov [edi+WDATA.box.height],eax |
.lp1: |
call set_window_clientbox |
add edi,0x20 |
loop @b |
/kernel/trunk/hid/mousedrv.inc |
---|
100,6 → 100,7 |
mov ecx, [ScreenWidth] |
inc ecx |
mul ecx |
movzx edx, byte [display_data+ebx+eax] |
shl edx, 8 |
mov ecx, [edx+SLOT_BASE+APPDATA.cursor] |
320,9 → 321,10 |
disable_m: |
cmp dword [MOUSE_VISIBLE],dword 0 |
jne no_mouse_disable |
pushf |
cli |
call draw_mouse_under |
sti |
popf |
mov [MOUSE_VISIBLE],dword 1 |
no_mouse_disable: |
popad |
350,9 → 352,10 |
mov [MOUSE_VISIBLE], dword 0 |
movzx ebx,word [MOUSE_Y] |
movzx eax,word [MOUSE_X] |
pushfd |
cli |
call save_draw_mouse |
sti |
popfd |
nodmu2: |
popad |
ret |
367,10 → 370,11 |
jne redrawmouse |
jmp nodmp |
redrawmouse: |
pushfd |
cli |
call draw_mouse_under |
call save_draw_mouse |
sti |
popfd |
nodmp: |
popad |
ret |
/kernel/trunk/kernel.asm |
---|
5061,6 → 5061,7 |
cpu_caps dd 4 dup(0) |
pg_data PG_DATA |
heap_test dd ? |
hd_entries rd 1 ;unused ? 0xfe10 |
endg |
iglobal |
/kernel/trunk/sound/sb16.inc |
---|
18,7 → 18,7 |
DMAPage equ 0x2A |
Rate equ 44100 |
SB16Buffer equ 0x2A0000 |
SB16_Status equ SB16Buffer+65536 |
;SB16_Status equ SB16Buffer+65536 |
iglobal |
sound_data_format dd 0x1 |
/kernel/trunk/video/vesa20.inc |
---|
38,7 → 38,7 |
getpixel: |
push eax ebx edx edi |
call dword [0xe024] |
call dword [GETPIXEL] |
pop edi edx ebx eax |
ret |
/kernel/trunk/vmodeld.inc |
---|
13,11 → 13,11 |
; LOAD VIDEOMODE DRIVER |
; If vmode.mdr file not found |
or eax,-1 ; Driver ID = -1 (not present in system) |
mov [0x760000],eax ; |
mov [0x760100],byte 0xC3 ; Instruction RETN - driver loop |
mov [OS_BASE+0x760000],eax ; |
mov [OS_BASE+0x760100],byte 0xC3 ; Instruction RETN - driver loop |
mov esi, vmode |
xor ebx, ebx |
mov ecx, 0x8000 ; size of memory area for driver |
mov edx, 0x760000 ; Memory position of driver |
call fs_RamdiskRead |
mov edx, OS_BASE+0x760000 ; Memory position of driver |
call fs_RamdiskRead |