/kernel/branches/gfx_kernel/boot/bootcode.inc |
---|
152,6 → 152,26 |
loop @b |
ret |
boot_read_floppy: |
push si |
xor si, si |
mov ah, 2 ; read |
@@: |
push ax |
int 0x13 |
pop ax |
jnc @f |
inc si |
cmp si, 10 |
jb @b |
mov si, badsect-0x10000 |
sayerr_plain: |
call printplain |
jmp $ |
@@: |
pop si |
ret |
org $+0x10000 |
; table for move to extended memory (int 15h, ah=87h) |
824,73 → 844,195 |
xor ax, ax ; reset drive |
xor dx, dx |
int 0x13 |
; now load floppy image to memory |
; at first load boot sector and first FAT table |
mov cx,0x0001 ; startcyl,startsector |
xor dx, dx ; starthead,drive |
push word 80*2 ; read no of sect |
reads: |
pusha |
xor si,si |
newread: |
mov bx,0xa000 ; es:bx -> data area |
mov ax,0x0200+18 ; read, no of sectors to read |
int 0x13 |
test ah, ah |
jz goodread |
inc si |
cmp si,10 |
jnz newread |
mov si,badsect-0x10000 |
sayerr_plain: |
call printplain |
jmp $ |
goodread: |
; move -> 1mb |
mov al, 1+9 ; no of sectors to read |
mov bx, 0xB000 ; es:bx -> data area |
call boot_read_floppy |
; and copy them to extended memory |
mov si,movedesc-0x10000 |
mov [si+8*2+3], bh |
push es |
push ds |
pop es |
mov cx,256*18 |
mov cx, 256*10 |
mov ah,0x87 |
int 0x15 |
pop es |
test ah,ah ; was the move successfull ? |
je goodmove |
mov dx,0x3f2 ; floppy motor off |
test ah, ah |
jz @f |
sayerr_floppy: |
mov dx, 0x3f2 |
mov al,0 |
out dx,al |
mov si,memmovefailed-0x10000 |
jmp sayerr_plain |
goodmove: |
add dword [movedesc-0x10000+0x18+2], 512*18 |
@@: |
add dword [si+8*3+2], 512*10 |
; copy FAT to second copy |
mov byte [si+8*2+3], 0xB2 |
mov cx, 256*9 |
mov ah, 0x87 |
int 0x15 |
pop es |
test ah, ah |
jnz sayerr_floppy |
add dword [si+8*3+2], 512*9 |
; calculate total number of sectors to read |
mov ax, 1+9+14 ; boot+FAT+root |
mov di, 0xB203 |
.calc_loop: |
test word [es:di], 0xFFF |
jz @f |
inc ax |
@@: |
test word [es:di+1], 0xFFF0 |
jz @f |
inc ax |
@@: |
add di, 3 |
cmp di, 0xB200+1440*3 |
jb .calc_loop |
push ax |
mov bp, 1+9 ; already read sectors |
; now read rest |
mov byte [si+8*2+3], 0xA0 |
mov di, 2-14 ; absolute sector-31 |
mov cx, 0x0002 ; cylinder=0, sector=2 |
mov dx, 0x0100 ; head=1, disk=0 |
.read_loop: |
; determine whether sector must be read |
cmp di, 2 |
jl .read |
mov bx, di |
shr bx, 1 |
jnc .even |
test word [es:bx+di+0xB200], 0xFFF0 |
jmp @f |
.even: |
test word [es:bx+di+0xB200], 0xFFF |
@@: |
jz .skip |
.read: |
mov bx, 0xA000 |
mov al, 1 ; 1 sector |
call boot_read_floppy |
inc bp |
push es |
push ds |
pop es |
pusha |
mov cx, 256 |
mov ah, 0x87 |
int 0x15 |
test ah, ah |
popa |
pop es |
jnz sayerr_floppy |
.skip: |
add dword [si+8*3+2], 512 |
inc cx |
cmp cl, 19 |
jnz @f |
mov cl, 1 |
inc dh |
cmp dh,2 |
jnz bb2 |
jnz @f |
mov dh,0 |
inc ch |
pusha ; print prosentage |
@@: |
pop ax |
push ax |
pusha |
; draw percentage |
; total sectors: ax |
; read sectors: bp |
xchg ax, bp |
mov cx, 100 |
mul cx |
div bp |
aam |
xchg al, ah |
add ax, '00' |
mov si,pros-0x10000 |
shr ch, 2 |
mov al, '5' |
test ch, 1 |
jnz @f |
mov al, '0' |
cmp [si], ax |
jz @f |
mov [si], ax |
call printplain |
@@: |
mov [si+1], al |
shr ch, 1 |
add ch, '0' |
mov [si], ch |
call printplain |
popa |
bb2: |
pop ax |
dec ax |
push ax |
jnz reads |
readdone: |
pop ax |
inc di |
cmp di, 2880-31 |
jnz .read_loop |
; mov cx,0x0001 ; startcyl,startsector |
; xor dx, dx ; starthead,drive |
; push word 80*2 ; read no of sect |
; reads: |
; pusha |
; xor si,si |
; newread: |
; mov bx,0xa000 ; es:bx -> data area |
; mov ax,0x0200+18 ; read, no of sectors to read |
; int 0x13 |
; test ah, ah |
; jz goodread |
; inc si |
; cmp si,10 |
; jnz newread |
; mov si,badsect-0x10000 |
;sayerr_plain: |
; call printplain |
; jmp $ |
; goodread: |
; ; move -> 1mb |
; mov si,movedesc-0x10000 |
; push es |
; push ds |
; pop es |
; mov cx,256*18 |
; mov ah,0x87 |
; int 0x15 |
; pop es |
; |
; test ah,ah ; was the move successfull ? |
; je goodmove |
; mov dx,0x3f2 ; floppy motor off |
; mov al,0 |
; out dx,al |
; mov si,memmovefailed-0x10000 |
; jmp sayerr_plain |
; goodmove: |
; |
; add dword [movedesc-0x10000+0x18+2], 512*18 |
; popa |
; inc dh |
; cmp dh,2 |
; jnz bb2 |
; mov dh,0 |
; inc ch |
; pusha ; print prosentage |
; mov si,pros-0x10000 |
; shr ch, 2 |
; mov al, '5' |
; test ch, 1 |
; jnz @f |
; mov al, '0' |
;@@: |
; mov [si+1], al |
; shr ch, 1 |
; add ch, '0' |
; mov [si], ch |
; call printplain |
; popa |
; bb2: |
; pop ax |
; dec ax |
; push ax |
; jnz reads |
; readdone: |
; pop ax |
mov si,backspace2-0x10000 |
call printplain |
mov si,okt-0x10000 |
/kernel/branches/gfx_kernel/boot/booteng.inc |
---|
62,7 → 62,8 |
.mem db "??? Mbytes)",13,10,0 |
gr_mode db "Select mode: ",13,10,0 |
s_bpp db 13,10,186," Bits per pixel: " |
.bpp dw "??",13,10,13,10,0 |
.bpp dw "??" |
db 13,10,0 |
vrrmprint db "Apply VRR? (picture frequency greater than 60Hz" |
db " only for transfers:",13,10 |
db 186," 1024*768->800*600 and 800*600->640*480) [1-yes,2-no]:",0 |
/kernel/branches/gfx_kernel/boot/bootru.inc |
---|
24,10 → 24,10 |
times 78 db 32 |
db 186 |
} |
d80x25_top: |
line_full_top |
space_msg: line_space |
verstr: |
verstr2: |
; line_space |
; version string |
db 186,32 |
38,12 → 38,14 |
end if |
db a |
end repeat |
repeat 78 - ($-verstr) |
repeat 78 - ($-verstr2) |
db ' ' |
end repeat |
db 32,186 |
verstr: |
line_half |
d80x25_top_num = 4 |
space_msg: line_space |
d80x25_top_num = 3 |
d80x25_bottom: |
db 186,' Kolibri OS ®á®¢ Menuet OS ¨ ¥ ¯à¥¤®áâ ¢«ï¥â ' |
db '¨ª ª¨å £ àa⨩. ',186 |
52,43 → 54,26 |
line_full_bottom |
d80x25_bottom_num = 3 |
msg_apm db " APM x.x ",0 |
novesa db "¨¤¥®ª àâ : EGA/CGA",13,10,0 |
vervesa db "¥àá¨ï VESA: Vesa x.x",13,10,0 |
vervesa_off=19 |
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, " |
db "[7] 1024x768, [8] 1280x1024",13,10 |
db 186," EGA/CGA 256 ¢¥â®¢: [9] 320x200, " |
db "VGA 16 ¢¥â®¢: [0] 640x480",13,10 |
db 186," ë¡¥à¨â¥ ¢¨¤¥®à¥¦¨¬: ",0 |
bt24 db "«ã¡¨ 梥â : 24",13,10,0 |
bt32 db "«ã¡¨ 梥â : 32",13,10,0 |
s_vesa db "¥àá¨ï VESA: " |
.ver db "?.? (" |
.mem db "??? ¡)",13,10,0 |
gr_mode db "ë¡¥à¨â¥ ¢¨¤¥®à¥¦¨¬: ",13,10,0 |
s_bpp db 13,10,186," «ã¡¨ 梥â : " |
.bpp dw "??" |
db 13,10,0 |
vrrmprint db "ᯮ«ì§®¢ âì VRR? (ç áâ®â ª ¤à®¢ ¢ëè¥ 60 æ" |
db " ⮫쪮 ¤«ï ¯¥à¥å®¤®¢:",13,10 |
db 186," 1024*768>800*600 ¨ 800*600>640*480) [1-¤ , 2-¥â]: ",0 |
;askmouse db "ëèì:" ; 186, " " |
; db " [1] PS/2 (USB), [2] Com1, [3] Com2." |
; db " ë¡¥à¨â¥ ¯®àâ [1-3]: ",0 |
;no_com1 db 13,10,186," No COM1 mouse",0 |
;no_com2 db 13,10,186," No COM2 mouse",0 |
gr_acc db "Vesa 2.0+: ª«îç¨âì MTRR ¤«ï ãáª®à¥¨ï £à 䨪¨? " |
db "[1-¤ /2-¥â]: ",0 |
;gr_direct db 186," ᯮ«ì§®¢ âì «¨¥©ë© ¢¨¤¥®¡ãä¥à? " |
; db "[1-¤ /2-¥â]: ",0 |
;mem_model db 13,10,186," ¡ê+¬ ¯ ¬ï⨠[1-16 Mb / 2-32 Mb / " |
; db "3-64Mb / 4-128 Mb / 5-256 Mb]: ",0 |
;bootlog db 13,10,186," à®á¬®âà¥âì ¦ãà « § £à㧪¨? [1-¥â/2-¤ ]: ",0 |
bdev db " £à㧨âì ®¡à § ¨§ [1-¤¨áª¥â ; 2-C:\menuet.img (FAT32);" |
db 13,10,186," " |
db "3-¨á¯®«ì§®¢ âì 㦥 § £àã¦¥ë© ®¡à §]: ",0 |
probetext db 13,10,13,10,186," â ¤ àâë© ¢¨¤¥®à¥¦¨¬? [1-¤ , " |
db "2-¯à®¢¥à¨âì ¤à㣨¥ (Vesa 3.0)]: ",0 |
;memokz256 db 13,10,186," RAM 256 Mb",0 |
;memokz128 db 13,10,186," RAM 128 Mb",0 |
;memokz64 db 13,10,186," RAM 64 Mb",0 |
;memokz32 db 13,10,186," RAM 32 Mb",0 |
;memokz16 db 13,10,186," RAM 16 Mb",0 |
prnotfnd db "訡ª - ¨¤¥®à¥¦¨¬ ¥ ©¤¥.",0 |
;modena db "訡ª - ॡã¥âáï ¯®¤¤¥à¦ª VBE 0x112+.",0 |
not386 db "訡ª - ॡã¥âáï ¯à®æ¥áá®à 386+.",0 |
131,3 → 116,33 |
loading_msg db "¤ñâ § £à㧪 KolibriOS...",0 |
save_quest db " ¯®¬¨âì ⥪ã騥 áâனª¨? [y/n]: ",0 |
loader_block_error db "訡ª ¢ ¤ ëå ç «ì®£® § £àã§ç¨ª , ¯à®¤®«¦¥¨¥ ¥¢®§¬®¦®.",0 |
_oem db 'oem: ',0 |
db 5 |
s_ven_intel db 'Intel' |
db 2 |
s_ven_s3 db 'S3' |
;db 5 |
;s_ven_bochs db 'Bochs' |
;db 8 |
;s_ven_vmware db 'V M ware' |
s_mode db " ????-????-?? (?) ",0 |
s_mode1 db " 0640-0480-04 (a) 0320-0200-08 (b) ",13,10,0 |
;_tl db 'ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄ¿',13,10,\ |
; '³ à §à¥è¥¨¥ ³ 4 ³ 8 ³ 15 ³ 16 ³ 24 ³ 32 ³',13,10,\ |
; 'ÃÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄ´',13,10,0 |
;_rs db '³ ????x???? ³ - ³ - ³ - ³ - ³ - ³ - ³',13,10,0 |
;_bt db 'ÀÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÙ',13,10,0 |
_tl db 186,' ÚÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄ¿',13,10,\ |
186,' ³ 4 ³ 8 ³ 15 ³ 16 ³ 24 ³ 32 ³',13,10,\ |
186,' ÚÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÅÄ¿',13,10,0 |
_rs db 186,' ³ ????x???? ³ ? ³ ? ³ ? ³ ? ³ ? ³ ? ³Û³',13,10,0 |
_bt db 186,' ÀÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÁÄÙ',13,10,0 |
_sel1 db 0x1A,0 |
_sel2 db 0x1B,0 |
/kernel/trunk/boot/bootcode.inc |
---|
150,6 → 150,26 |
loop @b |
ret |
boot_read_floppy: |
push si |
xor si, si |
mov ah, 2 ; read |
@@: |
push ax |
int 0x13 |
pop ax |
jnc @f |
inc si |
cmp si, 10 |
jb @b |
mov si, badsect-0x10000 |
sayerr_plain: |
call printplain |
jmp $ |
@@: |
pop si |
ret |
; 16-bit data |
; videomodes table |
org $+0x10000 |
210,6 → 230,7 |
mov ax, 3 |
int 0x10 |
if lang eq ru |
; Load & set russian VGA font (RU.INC) |
mov bp,RU_FNT1-10000h ; RU_FNT1 - First part |
mov bx,1000h ; 768 bytes |
225,6 → 246,7 |
mov ax,1100h |
int 10h |
; End set VGA russian font |
end if |
; draw frames |
push 0xb800 |
960,73 → 982,195 |
xor ax, ax ; reset drive |
xor dx, dx |
int 0x13 |
; now load floppy image to memory |
; at first load boot sector and first FAT table |
mov cx,0x0001 ; startcyl,startsector |
xor dx, dx ; starthead,drive |
push word 80*2 ; read no of sect |
reads: |
pusha |
xor si,si |
newread: |
mov bx,0xa000 ; es:bx -> data area |
mov ax,0x0200+18 ; read, no of sectors to read |
int 0x13 |
test ah, ah |
jz goodread |
inc si |
cmp si,10 |
jnz newread |
mov si,badsect-0x10000 |
sayerr_plain: |
call printplain |
jmp $ |
goodread: |
; move -> 1mb |
mov al, 1+9 ; no of sectors to read |
mov bx, 0xB000 ; es:bx -> data area |
call boot_read_floppy |
; and copy them to extended memory |
mov si,movedesc-0x10000 |
mov [si+8*2+3], bh |
push es |
push ds |
pop es |
mov cx,256*18 |
mov cx, 256*10 |
mov ah,0x87 |
int 0x15 |
pop es |
test ah,ah ; was the move successfull ? |
je goodmove |
mov dx,0x3f2 ; floppy motor off |
test ah, ah |
jz @f |
sayerr_floppy: |
mov dx, 0x3f2 |
mov al,0 |
out dx,al |
mov si,memmovefailed-0x10000 |
jmp sayerr_plain |
goodmove: |
add dword [movedesc-0x10000+0x18+2], 512*18 |
@@: |
add dword [si+8*3+2], 512*10 |
; copy FAT to second copy |
mov byte [si+8*2+3], 0xB2 |
mov cx, 256*9 |
mov ah, 0x87 |
int 0x15 |
pop es |
test ah, ah |
jnz sayerr_floppy |
add dword [si+8*3+2], 512*9 |
; calculate total number of sectors to read |
mov ax, 1+9+14 ; boot+FAT+root |
mov di, 0xB203 |
.calc_loop: |
test word [es:di], 0xFFF |
jz @f |
inc ax |
@@: |
test word [es:di+1], 0xFFF0 |
jz @f |
inc ax |
@@: |
add di, 3 |
cmp di, 0xB200+1440*3 |
jb .calc_loop |
push ax |
mov bp, 1+9 ; already read sectors |
; now read rest |
mov byte [si+8*2+3], 0xA0 |
mov di, 2-14 ; absolute sector-31 |
mov cx, 0x0002 ; cylinder=0, sector=2 |
mov dx, 0x0100 ; head=1, disk=0 |
.read_loop: |
; determine whether sector must be read |
cmp di, 2 |
jl .read |
mov bx, di |
shr bx, 1 |
jnc .even |
test word [es:bx+di+0xB200], 0xFFF0 |
jmp @f |
.even: |
test word [es:bx+di+0xB200], 0xFFF |
@@: |
jz .skip |
.read: |
mov bx, 0xA000 |
mov al, 1 ; 1 sector |
call boot_read_floppy |
inc bp |
push es |
push ds |
pop es |
pusha |
mov cx, 256 |
mov ah, 0x87 |
int 0x15 |
test ah, ah |
popa |
pop es |
jnz sayerr_floppy |
.skip: |
add dword [si+8*3+2], 512 |
inc cx |
cmp cl, 19 |
jnz @f |
mov cl, 1 |
inc dh |
cmp dh,2 |
jnz bb2 |
jnz @f |
mov dh,0 |
inc ch |
pusha ; print prosentage |
@@: |
pop ax |
push ax |
pusha |
; draw percentage |
; total sectors: ax |
; read sectors: bp |
xchg ax, bp |
mov cx, 100 |
mul cx |
div bp |
aam |
xchg al, ah |
add ax, '00' |
mov si,pros-0x10000 |
shr ch, 2 |
mov al, '5' |
test ch, 1 |
jnz @f |
mov al, '0' |
cmp [si], ax |
jz @f |
mov [si], ax |
call printplain |
@@: |
mov [si+1], al |
shr ch, 1 |
add ch, '0' |
mov [si], ch |
call printplain |
popa |
bb2: |
pop ax |
dec ax |
push ax |
jnz reads |
readdone: |
pop ax |
inc di |
cmp di, 2880-31 |
jnz .read_loop |
; mov cx, 0x0001 ; startcyl,startsector |
; xor dx, dx ; starthead,drive |
; push word 80*2 ; read no of sect |
; reads: |
; pusha |
; xor si,si |
; newread: |
; mov bx,0xa000 ; es:bx -> data area |
; mov ax,0x0200+18 ; read, no of sectors to read |
; int 0x13 |
; test ah, ah |
; jz goodread |
; inc si |
; cmp si,10 |
; jnz newread |
; mov si,badsect-0x10000 |
;sayerr_plain: |
; call printplain |
; jmp $ |
; goodread: |
; ; move -> 1mb |
; mov si,movedesc-0x10000 |
; push es |
; push ds |
; pop es |
; mov cx,256*18 |
; mov ah,0x87 |
; int 0x15 |
; pop es |
; |
; test ah,ah ; was the move successfull ? |
; je goodmove |
; mov dx,0x3f2 ; floppy motor off |
; mov al,0 |
; out dx,al |
; mov si,memmovefailed-0x10000 |
; jmp sayerr_plain |
; goodmove: |
; |
; add dword [movedesc-0x10000+0x18+2], 512*18 |
; popa |
; inc dh |
; cmp dh,2 |
; jnz bb2 |
; mov dh,0 |
; inc ch |
; pusha ; print prosentage |
; mov si,pros-0x10000 |
; shr ch, 2 |
; mov al, '5' |
; test ch, 1 |
; jnz @f |
; mov al, '0' |
;@@: |
; mov [si+1], al |
; shr ch, 1 |
; add ch, '0' |
; mov [si], ch |
; call printplain |
; popa |
; bb2: |
; pop ax |
; dec ax |
; push ax |
; jnz reads |
; readdone: |
; pop ax |
mov si,backspace2-0x10000 |
call printplain |
mov si,okt-0x10000 |