bootcode.inc: fixed error in loader block checks

dev_hdcd.inc: increased delay in reset function
kernel.asm: now kernel loads system programs (vrr_m/launcher and cpu) via fn 70
shutdown.inc: corrected code of rose output
IR, VRR_M: modified to use function 70 + optimization

git-svn-id: svn://kolibrios.org@143 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Evgeny Grechnikov (Diamond) 2006-08-31 12:56:29 +00:00
parent 7e19914ef4
commit 55d060c456
7 changed files with 188 additions and 239 deletions

View File

@ -233,14 +233,14 @@ uglobal
endg endg
iglobal iglobal
firstapp db 'LAUNCHER ' firstapp db '/rd/1/LAUNCHER',0
char db 'CHAR MT ' char db 'CHAR MT '
char2 db 'CHAR2 MT ' char2 db 'CHAR2 MT '
bootpath db '/KOLIBRI ' bootpath db '/KOLIBRI '
bootpath2 db 0 bootpath2 db 0
vmode db 'VMODE MDR' vmode db 'VMODE MDR'
cur_file db 'ARROW CUR' cur_file db 'ARROW CUR'
vrr_m db 'VRR_M ' vrr_m db '/rd/1/VRR_M',0
endg endg
@ -772,21 +772,22 @@ mov [256+12],ebx
mov [0x3000],dword 1 mov [0x3000],dword 1
mov [0x3004],dword 1 mov [0x3004],dword 1
cli cli
mov al,[0x2f0000+0x9030] cmp byte [0x2f0000+0x9030],1
cmp al,1
jne no_load_vrr_m jne no_load_vrr_m
mov eax,vrr_m mov ebp,vrr_m
lea esi,[ebp+6] ; skip '/RD/1/'
xor ebx,ebx ; no parameters xor ebx,ebx ; no parameters
xor edx,edx ; no flags xor edx,edx ; no flags
call start_application_fl call fs_RamdiskExecute.flags
cmp eax,2 ; if vrr_m app found (PID=2) cmp eax,2 ; if vrr_m app found (PID=2)
je first_app_found je first_app_found
no_load_vrr_m: no_load_vrr_m:
mov eax,firstapp mov ebp,firstapp
lea esi,[ebp+6]
xor ebx,ebx ; no parameters xor ebx,ebx ; no parameters
xor edx,edx ; no flags xor edx,edx ; no flags
call start_application_fl call fs_RamdiskExecute.flags
cmp eax,2 ; continue if a process has been loaded cmp eax,2 ; continue if a process has been loaded
je first_app_found je first_app_found
@ -3350,7 +3351,7 @@ uglobal
mouse_active db 0 mouse_active db 0
endg endg
iglobal iglobal
cpustring db 'CPU ' cpustring db '/RD/1/CPU',0
endg endg
uglobal uglobal
@ -3364,10 +3365,11 @@ checkmisc:
cmp [ctrl_alt_del], 1 cmp [ctrl_alt_del], 1
jne nocpustart jne nocpustart
mov eax, cpustring mov ebp, cpustring
lea esi,[ebp+6]
xor ebx,ebx ; no parameters xor ebx,ebx ; no parameters
xor edx,edx ; no flags xor edx,edx ; no flags
call start_application_fl call fs_RamdiskExecute.flags
mov [ctrl_alt_del], 0 mov [ctrl_alt_del], 0
nocpustart: nocpustart:
cmp [mouse_active], 1 cmp [mouse_active], 1

View File

@ -448,8 +448,8 @@ cfgmanager:
; d) preboot_device = from what boot? ; d) preboot_device = from what boot?
mov di, preboot_graph-0x10000 mov di, preboot_graph-0x10000
; check bootloader block ; check bootloader block
cmp [.loader_block-0x10000], 1 cmp [.loader_block-0x10000], -1
jnz .noloaderblock jz .noloaderblock
les bx, [.loader_block-0x10000] les bx, [.loader_block-0x10000]
cmp byte [es:bx], 1 cmp byte [es:bx], 1
mov si, loader_block_error-0x10000 mov si, loader_block_error-0x10000
@ -657,7 +657,7 @@ virtual at novesa
.timer dd ? .timer dd ?
end virtual end virtual
org $+0x10000 org $+0x10000
.loader_block dd 0 .loader_block dd -1
org $-0x10000 org $-0x10000
.gettime: .gettime:
mov ah, 0 mov ah, 0
@ -727,7 +727,7 @@ end if
_setcursor 15,0 _setcursor 15,0
cmp [.bSettingsChanged-0x10000], 0 cmp [.bSettingsChanged-0x10000], 0
jz .load jz .load
cmp [.loader_block-0x10000], 0 cmp [.loader_block-0x10000], -1
jz .load jz .load
les bx, [.loader_block-0x10000] les bx, [.loader_block-0x10000]
mov eax, [es:bx+3] mov eax, [es:bx+3]

View File

@ -136,7 +136,10 @@ system_shutdown: ; shut down the system
nrl: nrl:
call dtext call dtext
sub ebx,0x050000 ; sub ebx,0x050000
ror ebx, 16
sub bl, 0x05
ror ebx, 16
add eax,8 add eax,8
add ecx,31 add ecx,31
cmp cx,word 0x0001+25*31 cmp cx,word 0x0001+25*31

View File

@ -329,7 +329,7 @@ DeviceReset:
mov AL,08h mov AL,08h
inc DX ;регистр команд inc DX ;регистр команд
out DX,AL out DX,AL
mov ecx,0xffff mov ecx,0x80000
@@WaitHDReady_1: @@WaitHDReady_1:
; Проверить время ожидания ; Проверить время ожидания
dec ecx dec ecx

View File

@ -231,13 +231,13 @@ uglobal
endg endg
iglobal iglobal
firstapp db 'LAUNCHER ' firstapp db '/rd/1/LAUNCHER',0
char db 'CHAR MT ' char db 'CHAR MT '
char2 db 'CHAR2 MT ' char2 db 'CHAR2 MT '
bootpath db '/KOLIBRI ' bootpath db '/KOLIBRI '
bootpath2 db 0 bootpath2 db 0
vmode db 'VMODE MDR' vmode db 'VMODE MDR'
vrr_m db 'VRR_M ' vrr_m db '/rd/1/VRR_M',0
endg endg
@ -727,21 +727,22 @@ finit ;reset the registers, contents which are still equal RM
mov [0x3000],dword 1 mov [0x3000],dword 1
mov [0x3004],dword 1 mov [0x3004],dword 1
cli cli
mov al,[0x2f0000+0x9030] cmp byte [0x2f0000+0x9030],1
cmp al,1
jne no_load_vrr_m jne no_load_vrr_m
mov eax,vrr_m mov ebp,vrr_m
lea esi,[ebp+6] ; skip '/rd/1/'
xor ebx,ebx ; no parameters xor ebx,ebx ; no parameters
xor edx,edx ; no flags xor edx,edx ; no flags
call start_application_fl call fs_RamdiskExecute.flags
cmp eax,2 ; if vrr_m app found (PID=2) cmp eax,2 ; if vrr_m app found (PID=2)
je first_app_found je first_app_found
no_load_vrr_m: no_load_vrr_m:
mov eax,firstapp mov ebp,firstapp
lea esi,[ebp+6]
xor ebx,ebx ; no parameters xor ebx,ebx ; no parameters
xor edx,edx ; no flags xor edx,edx ; no flags
call start_application_fl call fs_RamdiskExecute.flags
cmp eax,2 ; continue if a process has been loaded cmp eax,2 ; continue if a process has been loaded
je first_app_found je first_app_found
@ -3336,7 +3337,7 @@ uglobal
mouse_active db 0 mouse_active db 0
endg endg
iglobal iglobal
cpustring db 'CPU ' cpustring db '/RD/1/CPU',0
endg endg
uglobal uglobal
@ -3350,10 +3351,11 @@ checkmisc:
cmp [ctrl_alt_del], 1 cmp [ctrl_alt_del], 1
jne nocpustart jne nocpustart
mov eax, cpustring mov ebp, cpustring
lea esi,[ebp+6]
xor ebx,ebx ; no parameters xor ebx,ebx ; no parameters
xor edx,edx ; no flags xor edx,edx ; no flags
call start_application_fl call fs_RamdiskExecute.flags
mov [ctrl_alt_del], 0 mov [ctrl_alt_del], 0
nocpustart: nocpustart:
cmp [mouse_active], 1 cmp [mouse_active], 1

View File

@ -8,43 +8,124 @@ use32
org 0x0 org 0x0
db 'MENUET00' ; 8 byte id db 'MENUET01' ; 8 byte id
dd 56 ; required os dd 1 ; required os
dd START ; program start dd START ; program start
dd I_END ; program image size dd I_END ; program image size
dd 0x1000 ; required amount of memory dd 0x1000 ; required amount of memory
dd 0x1000 ; esp = 0x7FFF0 dd 0x1000 ; esp = 0x7FFF0
dd 0x00000000 ; reserved=no extended header dd 0, 0
include 'lang.inc'
include 'macros.inc' include 'macros.inc'
START: ; start of execution START: ; start of execution
call draw_window ; at first, draw the window set_variables:
call set_variables mov eax,46 ; reserve ports 0x3f0 - 0x3ff
mov ebx,0
mov ecx,0x3f0
mov edx,0x3ff
int 0x40
mov eax,45 ; reserve irq 4
mov ebx,0
mov ecx,4
int 0x40
mov eax,44 ; set read ports for irq 4
mov ebx,irqtable
; mov ecx,4
int 0x40
mov dh, 3 ; all ports have number 3xx hex
mov dl, 0xf3+8
mov al, 0x80
out dx, al
mov dl, 0xf1+8
mov al, 0
out dx, al
mov dl, 0xf0+8
mov al, 0x30 / 4
out dx, al
mov dl, 0xf3+8
mov al, 3
out dx, al
mov dl, 0xf4+8
mov al, 0xB
out dx, al
mov dl, 0xf1+8
mov al, 1
out dx, al
mov eax,5
mov ebx,100
int 0x40
mov dl, 0xf8
mov al, 'I'
out dx, al
mov eax,5
mov ebx,10
int 0x40
mov al, 'R'
out dx, al
mov eax,40 ; get com 1 data with irq 4
mov ebx,0000000000010000b shl 16 + 101b
int 0x40
red:
call draw_window
still: still:
mov eax,10 ; wait here for event mov eax,10 ; wait here for event
int 0x40 int 0x40
dec eax
jz red
dec eax
dec eax
jnz readir
cmp eax,1 ; redraw request ? button: ; button
je red mov al,17 ; get id
cmp eax,2 ; key in buffer ? int 0x40
je key
cmp eax,3 ; button in buffer ?
je button
cmp eax,16+4
je readir
jmp still ; we have only one button, close
mov eax,45 ; free irq
mov ebx,1
mov ecx,4
int 0x40
mov eax,46 ; free ports 0x3f0-0x3ff
mov ebx,1
mov ecx,0x3f0
mov edx,0x3ff
int 0x40
or eax,-1 ; close this program
int 0x40
pos dd 0x0 pos dd 0x0
cdplayer db 'CDPLAY ' cdplayer:
dd 7
dd 0
dd 0
dd 0
dd 0
db '/RD/1/CDP',0
readir: readir:
mov eax,42 mov eax,42
@ -54,9 +135,8 @@ cdplayer db 'CDPLAY '
cmp ebx,80 cmp ebx,80
jne nocd jne nocd
mov eax,19 mov eax,70
mov ebx,cdplayer mov ebx,cdplayer
mov ecx,0
int 0x40 int 0x40
@ -85,38 +165,6 @@ cdplayer db 'CDPLAY '
call draw_data call draw_data
jmp still jmp still
red: ; redraw
call draw_window
jmp still
key: ; key
mov eax,2 ; just read it and ignore
int 0x40
jmp still
button: ; button
mov eax,17 ; get id
int 0x40
cmp ah,1 ; button id=1 ?
jne noclose
mov eax,45 ; free irq
mov ebx,1
mov ecx,4
int 0x40
mov eax,46 ; free ports 0x3f0-0x3ff
mov ebx,1
mov ecx,0x3f0
mov edx,0x3ff
int 0x40
mov eax,-1 ; close this program
int 0x40
noclose:
jmp still
@ -149,107 +197,9 @@ irqtable:
dd 0x3f8+0x01000000 ; + 01 = read byte, 02 read word dd 0x3f8+0x01000000 ; + 01 = read byte, 02 read word
dd 0 dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
set_variables:
pusha
mov eax,46 ; reserve ports 0x3f0 - 0x3ff
mov ebx,0
mov ecx,0x3f0
mov edx,0x3ff
int 0x40
mov eax,45 ; reserve irq 4
mov ebx,0
mov ecx,4
int 0x40
mov eax,46 ; reserve ports 0x3f0-0x3ff
mov ebx,0
mov ecx,0x3f0
mov edx,0x3ff
int 0x40
mov eax,44 ; set read ports for irq 4
mov ebx,irqtable
mov ecx,4
int 0x40
mov cx,0x3f3+8
mov bl,0x80
mov eax,43
int 0x40
mov cx,0x3f1+8
mov bl,0
mov eax,43
int 0x40
mov cx,0x3f0+8
mov bl,0x30 / 4
mov eax,43
int 0x40
mov cx,0x3f3+8
mov bl,3
mov eax,43
int 0x40
mov cx,0x3f4+8
mov bl,0xB
mov eax,43
int 0x40
mov cx,0x3f1+8
mov bl,1
mov eax,43
int 0x40
mov eax,5
mov ebx,100
int 0x40
mov cx,0x3f8
mov bl,'I'
mov eax,43
int 0x40
mov eax,5
mov ebx,10
int 0x40
mov cx,0x3f8
mov bl,'R'
mov eax,43
int 0x40
mov eax,40 ; get com 1 data with irq 4
mov ebx,0000000000010000b shl 16 + 111b
int 0x40
popa
ret
; ********************************************* ; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ******** ; ******* WINDOW DEFINITIONS AND DRAW ********
; ********************************************* ; *********************************************
@ -266,38 +216,27 @@ draw_window:
mov ebx,100*65536+300 ; [x start] *65536 + [x size] mov ebx,100*65536+300 ; [x start] *65536 + [x size]
mov ecx,100*65536+250 ; [y start] *65536 + [y size] mov ecx,100*65536+250 ; [y start] *65536 + [y size]
mov edx,[wcolor] ; color of work area RRGGBB,8->color mov edx,[wcolor] ; color of work area RRGGBB,8->color
mov esi,0x8099bbff ; color of grab bar RRGGBB,8->color glide mov edi,labelt ; caption string
mov edi,0x00ffffff ; color of frames RRGGBB
int 0x40 int 0x40
; WINDOW LABEL ; ; WINDOW LABEL
mov eax,4 ; function 4 : write text to window ; mov eax,4 ; function 4 : write text to window
mov ebx,8*65536+8 ; [x start] *65536 + [y start] ; mov ebx,8*65536+8 ; [x start] *65536 + [y start]
mov ecx,0x00ffffff ; color of text RRGGBB ; mov ecx,0x00ffffff ; color of text RRGGBB
mov edx,labelt ; pointer to text beginning ; mov edx,labelt ; pointer to text beginning
mov esi,labellen-labelt ; text length ; mov esi,labellen-labelt ; text length
int 0x40
; CLOSE BUTTON
mov eax,8 ; function 8 : define and draw button
mov ebx,(300-19)*65536+12 ; [x start] *65536 + [x size]
mov ecx,5*65536+12 ; [y start] *65536 + [y size]
mov edx,1 ; button id
mov esi,0x5599cc ; button color RRGGBB
; int 0x40 ; int 0x40
call draw_text ; CLOSE BUTTON
; mov eax,8 ; function 8 : define and draw button
mov eax,12 ; mov ebx,(300-19)*65536+12 ; [x start] *65536 + [x size]
mov ebx,2 ; mov ecx,5*65536+12 ; [y start] *65536 + [y size]
int 0x40 ; mov edx,1 ; button id
; mov esi,0x5599cc ; button color RRGGBB
ret ; int 0x40
draw_text: draw_text:
pusha
mov ebx,25*65536+35 ; draw info text with function 4 mov ebx,25*65536+35 ; draw info text with function 4
mov ecx,0xffffff mov ecx,0xffffff
mov edx,text mov edx,text
@ -307,27 +246,23 @@ draw_text:
mov eax,4 mov eax,4
int 0x40 int 0x40
add ebx,10 add ebx,10
add edx,40 add edx,esi
dec edi dec edi
jne newline jne newline
popa mov eax,12
mov ebx,2
int 0x40
ret ret
; DATA AREA ; DATA AREA
wcolor dd 0x03000000 wcolor dd 0x13000000
labelt db 'INFRARED RECEIVER FOR IRMAN IN COM 1' labelt db 'INFRARED RECEIVER FOR IRMAN IN COM 1',0
labellen:
text: text:
I_END: I_END:

View File

@ -23,8 +23,7 @@
dd 0x0 ;  ¤à¥á ¡ãä¥à  ¤«ï ¯ à ¬¥â஢ (­¥ ¨á¯®«ì§ã¥âáï) dd 0x0 ;  ¤à¥á ¡ãä¥à  ¤«ï ¯ à ¬¥â஢ (­¥ ¨á¯®«ì§ã¥âáï)
dd 0x0 ; § à¥§¥à¢¨à®¢ ­® dd 0x0 ; § à¥§¥à¢¨à®¢ ­®
include 'lang.inc' include 'MACROS.INC' ; ¬ ªà®áë ®¡«¥£ç îâ ¦¨§­ì  áᥬ¡«¥à騪®¢!
include 'macros.inc' ; ¬ ªà®áë ®¡«¥£ç îâ ¦¨§­ì  áᥬ¡«¥à騪®¢!
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
;--- <20>€—€Ž <20><>Žƒ<C5BD>€ŒŒ ---------------------------------------------- ;--- <20>€—€Ž <20><>Žƒ<C5BD>€ŒŒ ----------------------------------------------
@ -32,11 +31,21 @@ include 'macros.inc' ;
START: START:
; mcall 5,10 ; mcall 5,10
mcall 21,13,1,drvinfo mov ecx, 1
mov edx, drvinfo
push @f
jmp call_driver
@@:
; jmp run_launcher ; jmp run_launcher
mcall 21,13,2 mov ecx, 2
cmp eax,-1 push @f
call_driver:
mcall 21,13
ret
@@:
; cmp eax,-1
inc eax
je run_launcher je run_launcher
; cmp ecx,280 ; cmp ecx,280
; je change_vrr ; je change_vrr
@ -64,34 +73,34 @@ change_vrr:
; mov dx,[_m1+ebx] ; mov dx,[_m1+ebx]
; rol edx,16 ; rol edx,16
;mov eax,ecx ;mov eax,ecx
xor eax,eax mov eax, 10
sub ecx,3 cmp cx,277+3
mov dx,cx
cmp cx,274
je yes_274
cmp cx,277
je yes_277 je yes_277
jmp yes_280 cmp cx,274+3
jne yes_280
yes_274: yes_274:
add al,10 add al,10
yes_277: yes_277:
add al,10 add al,10
yes_280: yes_280:
add al,10 mov edx, [_m1+eax-2]
ror edx,16 lea dx, [ecx-3]
mov dx,[_m1+eax] push run_launcher
rol edx,16 mov ecx, 3
; mov dx,bx jmp call_driver
; shl edx,16
; mov dx,cx
mcall 21,13,3
; mcall 5,300
run_launcher: run_launcher:
mcall 19,launcher,0 mcall 70,launcher
; mcall 33,text,drvinfo,512,0
mcall -1 mcall -1
launcher db 'LAUNCHER ' launcher:
;text db 'TEXT ' dd 7
dd 0
dd 0
dd 0
dd 0
db '/RD/1/LAUNCHER'
I_END: ; ¬¥âª  ª®­æ  ¯à®£à ¬¬ë
db ? ; system loader will zero all memory after program end
; this byte will be terminating zero for launcher string
drvinfo: ; 512 bytes driver info area drvinfo: ; 512 bytes driver info area
; +0 - Full driver name ; +0 - Full driver name
; +32 - Driver version ; +32 - Driver version
@ -104,5 +113,3 @@ vidmode:
org $+64 org $+64
_m1: _m1:
org drvinfo+200h org drvinfo+200h
I_END: ; ¬¥âª  ª®­æ  ¯à®£à ¬¬ë