/kernel/trunk/boot/bootcode.inc |
---|
0,0 → 1,917 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; BOOTCODE.INC ;; |
;; ;; |
;; 16 bit bootcode for MenuetOS ;; |
;; ;; |
;; Copyright 2002 Ville Turjanmaa ;; |
;; ;; |
;; See file COPYING for details ;; |
;; ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;========================================================================== |
; |
; 16 BIT FUNCTIONS |
; |
;========================================================================== |
print: push si |
mov si,leftpr-0x10000 |
call printplain |
pop si |
printplain: pusha |
mov dx,0x1000 |
mov es,dx |
cmp byte [es:display_atboot-0x10000],2 |
je printplain_exit |
mov ds,dx |
cld |
lodsb |
prpl1: |
mov ah,0xe |
xor bh,bh |
int 0x10 |
lodsb |
cmp al,0 |
jne prpl1 |
printplain_exit: |
popa |
ret |
setbase1000: push ax |
mov ax,0x1000 |
mov es,ax |
mov ds,ax |
pop ax |
ret |
getkey: push ecx |
push edx |
add ebx,0x0101 |
xor eax,eax |
gk1: |
in al,0x60 |
mov cl,al |
gk0: |
in al,0x60 |
cmp al,cl |
je gk0 |
cmp ax,11 |
jg gk0 |
gk0_1: |
mov cl,al |
; add al,47 |
; mov [ds:keyinbs-0x10000],al |
; mov si,keyinbs-0x10000 |
; call printplain |
gk12: |
in al,0x60 |
cmp al,cl |
je gk12 |
cmp ax,240 |
jne gk13 |
mov al,cl |
jmp gk14 |
gk13: |
add cl,128 |
cmp al,cl |
jne gk1 |
sub al,128 |
gk14: |
movzx edx,bl |
cmp eax,edx |
jb gk1 |
movzx edx,bh |
cmp eax,edx |
jg gk1 |
test ebx,0x010000 |
jnz gk3 |
mov cx,0x1000 |
mov dx,cx |
add eax,47 |
mov cx,ax |
cmp cx,58 |
jb gk_nozero |
sub cx,10 |
gk_nozero: |
mov [ds:keyin-0x10000],cl |
mov si,keyin-0x10000 |
call printplain |
gk3: |
sub eax,48 |
pop edx |
pop ecx |
ret |
;========================================================================= |
; |
; 16 BIT CODE |
; |
;========================================================================= |
start_of_code: |
; RESET 16 BIT SELECTORS/REGISTERS/STACK |
mov ax,0x1000 |
mov es,ax |
mov ds,ax |
mov ax,0x2000 |
mov ss,ax |
mov sp,0xffff |
xor ax,ax |
xor bx,bx |
xor cx,cx |
xor dx,dx |
xor si,si |
xor di,di |
xor bp,bp |
; DRAW FRAMES |
call setbase1000 |
cmp byte [es:display_atboot-0x10000],2 |
je no_mode_atboot |
mov ax,0x0003 |
mov bx,0x0000 |
mov dx,0x0000 |
int 0x10 |
no_mode_atboot: |
; Load & set russian VGA font (RU.INC) |
mov bp,RU_FNT1-10000h ; RU_FNT1 - First part |
mov bx,1000h ; 768 bytes |
mov cx,30h ; 48 symbols |
mov dx,80h ; 128 - position of first symbol |
mov ax,1100h |
push cs |
pop es |
int 10h |
mov bp,RU_FNT2-10000h ; RU_FNT2 -Second part |
mov bx,1000h ; 512 bytes |
mov cx,20h ; 32 symbols |
mov dx,0E0h ; 224 - position of first symbol |
mov ax,1100h |
push cs |
pop es |
int 10h |
; End set VGA russian font |
call setbase1000 |
mov ax,0xb800 |
mov es,ax |
mov di,0 |
mov si,d80x25-0x10000 |
mov cx,80*25 |
mov ah,1*16+15 |
dfl1: |
cld |
lodsb |
stosw |
loop dfl1 |
call setbase1000 |
; SAY HI TO USER |
mov si,linef2-0x10000 |
call printplain |
mov si,version-0x10000 |
call print |
; TEST FOR 386+ |
pushf |
pop ax |
mov dx,ax |
xor ax,0x4000 |
push ax |
popf |
pushf |
pop ax |
and ax,0x4000 |
and dx,0x4000 |
cmp ax,dx |
jnz cpugood |
mov si,not386-0x10000 |
call print |
jmp $ |
cpugood: |
; RESET 32 BIT SELECTORS/REGISTERS/SELECTORS |
mov ax,0x1000 |
mov es,ax |
mov ds,ax |
mov ax,0x2000 |
mov ss,ax |
mov esp,0xffff |
xor eax,eax |
xor ebx,ebx |
xor ecx,ecx |
xor edx,edx |
xor esi,esi |
xor edi,edi |
xor ebp,ebp |
; FLUSH 8042 KEYBOARD CONTROLLER |
;// mike.dld [ |
; mov al,0xED |
; out 0x60,al |
; or cx,-1 |
; @@: |
; in al,0x64 |
; test al,2 |
; jz @f |
; loop @b |
; @@: |
; mov al,0 |
; out 0x60,al |
; or cx,-1 |
; @@: |
; in al,0x64 |
; test al,2 |
; jz @f |
; loop @b |
; @@: |
;// mike.dld ] |
; mov ecx,10000 |
; fl1: |
; in al,0x64 |
; loop fl1 |
; test al,1 |
; jz fl2 |
; in al,0x60 |
; jmp fl1 |
; fl2: |
;**************************************************************** |
; The function is modified Mario79 |
;***************************************************************** |
; wait_kbd: ; variant 1 |
; mov cx,2500h ;çàäåðæêà ïîðÿäêà 10 ìñåê |
; test_kbd: |
; in al,64h ;÷èòàåì ñîñòîÿíèå êëàâèàòóðû |
; test al,2 ;ïðîâåðêà áèòà ãîòîâíîñòè |
; loopnz test_kbd |
mov al,0xf6 ; Ñáðîñ êëàâèàòóðû, ðàçðåøèòü ñêàíèðîâàíèå |
out 0x60,al |
mov cx,0 |
wait_loop: ; variant 2 |
; reading state of port of 8042 controller |
in al,64h |
and al,00000010b ; ready flag |
; wait until 8042 controller is ready |
loopnz wait_loop |
; DISPLAY VESA INFORMATION |
mov ax,0x0 |
mov es,ax |
mov ax,0x4f00 |
mov di,0xa000 |
int 0x10 |
cmp ax,0x004f |
je vesaok2 |
mov dx,0x1000 |
mov es,dx |
mov si,novesa-0x10000 |
call print |
mov ax,16 |
jmp novesafound |
vesaok2: |
mov ax,[es:di+4] |
mov dx,ax |
add ax,'0'*256+'0' |
push word 0x1000 |
pop es |
mov [es:vervesa+vervesa_off-0x10000], ah |
mov [es:vervesa+vervesa_off+2-0x10000], al |
; ivan 24/11/2004 begin |
;push ax |
; ivan 24/11/2004 end |
mov si,vervesa-0x10000 |
call print |
novesafound: |
call setbase1000 |
; ivan 24/11/2004 begin |
;pop bx |
; ivan 24/11/2004 end |
; ASK GRAPHICS MODE |
movzx eax,byte [es:preboot_graph-0x10000] |
cmp eax,0 |
jne pre_graph |
mov si,gr_mode-0x10000 |
call printplain |
gml0: |
mov ebx,0x0A01 |
call getkey |
pre_graph: |
cmp eax,1 |
jl sgml1 |
cmp eax,8 |
jg sgml1 |
mov si,ax |
sub si,1 |
shl si,4 |
add si,gr_table-0x10000 |
mov bx,[es:si+0] |
mov cx,[es:si+4] |
mov dx,[es:si+8] |
jmp gml10 |
sgml1: |
cmp al,9 |
jnz gml00 |
mov bx,0x13 |
mov cx,640 |
mov dx,480 |
push word 0x0 |
pop es |
mov [es:0x9000],byte 32 |
mov dword [es:0x9018],0x800000 |
push word 0x1000 |
pop es |
jmp gml10 |
gml00: |
cmp al,0xa |
jnz gml02 |
mov bx,0x12 |
mov cx,640 |
mov dx,480 |
push word 0x0 |
pop es |
mov [es:0x9000],byte 32 |
mov dword [es:0x9018],0x800000 |
push word 0x1000 |
pop es |
jmp gml10 |
gml02: |
jmp gml0 |
gr_table: |
dd 0x112+0100000000000000b , 640 , 480 , 0 |
dd 0x115+0100000000000000b , 800 , 600 , 0 |
dd 0x118+0100000000000000b , 1024 , 768 , 0 |
dd 0x11B+0100000000000000b , 1280 , 1024 , 0 |
dd 0x112 , 640 , 480 , 0 |
dd 0x115 , 800 , 600 , 0 |
dd 0x118 , 1024 , 768 , 0 |
dd 0x11B , 1280 ,1024 , 0 |
gml10: |
push word 0x0000 |
pop es |
mov [es:0x9008],bx |
mov [es:0x900A],cx |
mov [es:0x900C],dx |
push word 0x1000 |
pop es |
mov ax,32 |
cmp bx,0x13 |
je nov |
cmp bx,0x12 |
je nov |
; USE DEFAULTS OR PROBE |
; bx - mode : cx - x size : dx - y size |
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
movzx ax,[es:preboot_gprobe-0x10000] |
test ax,ax |
jne pre_probe |
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
test bx,0100000000000000b |
jz noprobe |
mov si,probetext-0x10000 |
call printplain |
push bx |
mov ebx,0x0201 |
call getkey |
pop bx |
pre_probe: |
cmp ax,1 |
je noprobe |
push cx dx |
mov bx,0x100 |
newprobe: |
inc bx |
cmp bx,0x17f |
jne probemore |
mov si,prnotfnd-0x10000 |
call printplain |
jmp $ |
probemore: |
mov ax,0x4f01 |
mov cx,bx |
and cx,0xfff |
push word 0x0000 |
pop es |
mov di,0xa000 |
int 0x10 |
mov eax,[es:di] ; lfb ? |
test eax,10000000b |
jz newprobe |
mov eax,[es:di+0x12] ; x size ? |
cmp ax,word [esp+2] |
jne newprobe |
mov eax,[es:di+0x14] ; y size ? |
cmp ax,dx |
jne newprobe |
movzx eax,byte [es:di+0x19] |
cmp eax,32 ;24 |
jb newprobe |
push word 0x0000 ; save probed mode |
pop es |
add bx,0100000000000000b |
mov [es:0x9008],bx |
push word 0x1000 |
pop es |
push bx |
mov si,prid-0x10000 |
call printplain |
pop bx dx cx |
noprobe: |
; FIND VESA 2.0 LFB & BPP |
mov ax,0x4f01 |
mov cx,bx |
and cx,0xfff |
push word 0x0000 |
pop es |
mov di,0xa000 |
int 0x10 |
; LFB |
mov ecx,[es:di+0x28] |
mov [es:0x9018],ecx |
; BPP |
movzx ax,byte [es:di+0x19] |
mov [es:0x9000],ax |
; ---- vbe voodoo |
BytesPerScanLine equ 0x10 |
push ax |
mov ax, [es:di+BytesPerScanLine] |
mov [es:0x9001],ax |
pop ax |
; ----- |
nov: |
cmp ax,24 |
jnz nbpp24 |
mov si,bt24-0x10000 |
jmp bppl |
nbpp24: |
cmp ax,32 |
jnz nbpp32 |
mov si,bt32-0x10000 |
jmp bppl |
nbpp32: |
mov si,btns-0x10000 |
call print |
jmp $ |
bppl: |
call printplain |
; FIND VESA 1.2 PM BANK SWITCH ADDRESS |
mov ax,0x4f0A |
mov bx,0x0 |
int 0x10 |
xor eax,eax |
xor ebx,ebx |
mov ax,es |
shl eax,4 |
mov bx,di |
add eax,ebx |
xor ebx,ebx |
mov bx,[es:di] |
add eax,ebx |
push word 0x0 |
pop es |
mov [es:0x9014],eax |
push word 0x1000 |
pop es |
; GRAPHICS ACCELERATION |
mov al, [es:preboot_mtrr-0x10000] |
test al,al |
jne pre_mtrr |
mov si,gr_acc-0x10000 |
call printplain |
mov ebx,0x0201 |
call getkey |
pre_mtrr: |
push word 0x0000 |
pop es |
mov [es:0x901C],al |
push word 0x1000 |
pop es |
mov si,linef-0x10000 |
call printplain |
; VRR_M USE |
mov al,[es:preboot_vrrm-0x10000] |
test al,al |
jne pre_vrrm |
mov si,vrrmprint-0x10000 |
call print |
mov ebx,0x0301 |
call getkey |
pre_vrrm: |
push word 0x0000 |
pop es |
mov [es:0x9030],al |
push word 0x1000 |
pop es |
mov si,linef2-0x10000 |
call printplain |
; MEMORY MODEL |
; movzx eax,byte [es:preboot_memory-0x10000] |
; cmp eax,0 |
; jne pre_mem |
;;;;;;;;;;;;;;;;;;;;;;;;; |
; mario79 - memory size ; |
;;;;;;;;;;;;;;;;;;;;;;;;; |
; mov ax,0E801h |
;;; xor bx,bx ; thanks to Alexei for bugfix [18.07.2004] |
; xor cx, cx |
; xor dx, dx |
; int 0x15 |
; movzx ebx, dx ;bx |
; movzx eax, cx ;ax |
; shl ebx,6 ; ïåðåâîä â êèëîáàéòû (x64) |
; add eax,ebx |
; add eax, 1000h ;440h |
; cmp eax,40000h ; 256? |
; jge mem_256_z |
; cmp eax,20000h ; 128? |
; jge mem_128_z |
; cmp eax,10000h ; 64? |
; jge mem_64_z |
; cmp eax,8000h ; 32? |
; jge mem_32_z |
; jmp mem_16_z |
; |
;mem_256_z: mov si,memokz256-0x10000 |
; call printplain |
; mov eax,5 |
; jmp pre_mem |
;mem_128_z: mov si,memokz128-0x10000 |
; call printplain |
; mov eax,4 |
; jmp pre_mem |
;mem_64_z: mov si,memokz64-0x10000 |
; call printplain |
; mov eax,3 |
; jmp pre_mem |
;mem_32_z: mov si,memokz32-0x10000 |
; call printplain |
; mov eax,2 |
; jmp pre_mem |
;mem_16_z: mov si,memokz16-0x10000 |
; call printplain |
; mov eax,1 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
; pre_mem: |
; push word 0x0000 |
; pop es |
; mov [es:0x9030],al |
; push word 0x1000 |
; pop es |
; mov si,linef-0x10000 |
; call printplain |
; DIRECT WRITE TO LFB, PAGING DISABLED |
; movzx eax,byte [es:preboot_lfb-0x10000] |
; mov eax,1 ; paging disabled |
; cmp eax,0 |
; jne pre_lfb |
; mov si,gr_direct-0x10000 |
; call printplain |
; mov ebx,0x0201 |
; call getkey |
; pre_lfb: |
; push word 0x0000 |
; pop es |
; mov [es:0x901E],al |
; mov ax,0x1000 |
; mov es,ax |
; mov si,linef-0x10000 |
; call printplain |
push 0 |
pop es |
mov [es:0x901E],byte 1 |
push 0x1000 |
pop es |
; BOOT DEVICE |
movzx eax,byte [es:preboot_device-0x10000] |
cmp eax,0 |
jne pre_device |
mov si,bdev-0x10000 |
call printplain |
mov ebx,0x0301 |
call getkey |
pre_device: |
dec al |
mov [es:boot_dev-0x10000],al |
mov si,linef-0x10000 |
call printplain |
; READ DISKETTE TO MEMORY |
cmp [boot_dev-0x10000],0 |
jne no_sys_on_floppy |
mov si,diskload-0x10000 |
call print |
mov ax,0x0000 ; reset drive |
mov dx,0x0000 |
int 0x13 |
mov cx,0x0001 ; startcyl,startsector |
mov dx,0x0000 ; starthead,drive |
push word 80*2 ; read no of sect |
reads: |
pusha |
xor si,si |
newread: |
push word 0x0 |
pop es |
mov bx,0xa000 ; es:bx -> data area |
mov ax,0x0200+18 ; read, no of sectors to read |
int 0x13 |
cmp ah,0 |
jz goodread |
add si,1 |
cmp si,10 |
jnz newread |
mov si,badsect-0x10000 |
call printplain |
jmp $ |
goodread: |
; move -> 1mb |
mov si,movedesc-0x10000 |
push word 0x1000 |
pop es |
mov cx,256*18 |
mov ah,0x87 |
int 0x15 |
cmp ah,0 ; was the move successfull ? |
je goodmove |
mov dx,0x3f2 ; floppy motor off |
mov al,0 |
out dx,al |
mov si,memmovefailed-0x10000 |
call print |
jmp $ |
goodmove: |
mov eax,[es:movedesc-0x10000+0x18+2] |
add eax,512*18 |
mov [es:movedesc-0x10000+0x18+2],eax |
popa |
inc dh |
cmp dh,2 |
jnz bb2 |
mov dh,0 |
inc ch |
pusha ; print prosentage |
push word 0x1000 |
pop es |
xor eax,eax ; 5 |
mov al,ch |
shr eax,2 |
and eax,1 |
mov ebx,5 |
mul bx |
add al,48 |
mov [es:pros+1-0x10000],al |
xor eax,eax ; 10 |
mov al,ch |
shr eax,3 |
add al,48 |
mov [es:pros-0x10000],al |
mov si,pros-0x10000 |
call printplain |
popa |
bb2: |
pop ax |
dec ax |
push ax |
cmp ax,0 |
jnz rs |
jmp readdone |
rs: |
jmp reads |
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 |
readdone: |
pop ax |
mov dx,0x3f2 ; floppy motor off |
mov al,0 |
out dx,al |
mov si,backspace-0x10000 |
call printplain |
call printplain |
mov si,okt-0x10000 |
call printplain |
no_sys_on_floppy: |
mov ax,0x0000 ; reset drive |
mov dx,0x0000 |
int 0x13 |
mov dx,0x3f2 ; floppy motor off |
mov al,0 |
out dx,al |
; PAGE TABLE |
push word 0x0000 |
pop es |
mov ecx,[es:0x9018] |
push ecx |
map_mem equ 64 ; amount of memory to map |
mov bx,0x6000 |
mov es,bx ; [es:di] = 6000:0 |
xor edi,edi |
mov ecx,256*map_mem ; Map (mapmem) M |
mov eax,7 |
cld |
pt2: |
cmp ecx,256*(map_mem-8) ; 8 M map to LFB |
jnz pt3 |
pop eax |
add eax,7 |
pt3: |
cmp ecx,256*(map_mem-12) ; 12 M back to linear = physical |
jnz pt4 |
mov eax,12*0x100000 + 7 |
pt4: |
stosd |
add eax,4096 |
loop pt2 |
mov bx,0x7100 |
mov es,bx |
xor edi,edi |
mov eax,8*0x100000+7 |
mov ecx,256*4 |
pt5: |
stosd |
add eax,0x1000 |
loop pt5 |
; 4 KB PAGE DIRECTORY |
mov bx , 0x7F00 |
mov es , bx ; [es:di] = 7000:0 |
xor edi, edi |
mov ecx, 64 / 4 |
mov eax, 0x60007 ; for 0 M |
cld |
pd4k: |
stosd |
add eax, 0x1000 |
loop pd4k |
mov dword [es:0x800],0x71007 ;map region 0x80000000-0x803FFFFF to 0x800000-0xCFFFFF |
xor esi,esi |
mov edi,second_base_address shr 20 |
mov ecx,64/4 |
mov bx,0x7F00 |
mov ds,bx |
rep movsd |
mov bx,0x1000 |
mov ds,bx |
mov eax, 0x7F000 +8+16 ; Page directory and enable caches |
mov cr3, eax |
; SET GRAPHICS |
mov dx,0x0000 |
mov es,dx |
mov bx,[es:0x9008] |
mov ax,bx ; vga & 320x200 |
cmp ax,0x13 |
je setgr |
cmp ax,0x12 |
je setgr |
mov ax,0x4f02 ; Vesa |
setgr: |
int 0x10 |
cmp ah,0 |
jz gmok |
mov si,fatalsel-0x10000 |
call print |
jmp $ |
gmok: |
mov dx,0x1000 |
mov es,dx |
; set mode 0x12 graphics registers: |
cmp bx,0x12 |
jne gmok2 |
mov al,0x05 |
mov dx,0x03ce |
out dx,al ; select GDC mode register |
mov al,0x02 |
mov dx,0x03cf |
out dx,al ; set write mode 2 |
mov al,0x02 |
mov dx,0x03c4 |
out dx,al ; select VGA sequencer map mask register |
mov al,0x0f |
mov dx,0x03c5 |
out dx,al ; set mask for all planes 0-3 |
mov al,0x08 |
mov dx,0x03ce |
out dx,al ; select GDC bit mask register |
; for writes to 0x03cf |
gmok2: |
mov dx,0x1000 |
mov es,dx |
/kernel/trunk/boot/booteng.inc |
---|
0,0 → 1,109 |
;====================================================================== |
; |
; BOOT DATA |
; |
;====================================================================== |
macro line_full_top { |
db 201 |
times 78 db 205 |
db 187 |
} |
macro line_full_bottom { |
db 200 |
times 78 db 205 |
db 188 |
} |
macro line_half { |
db 186,' ' |
times 76 db 0xc4 |
db ' ',186 |
} |
macro line_space { |
db 186 |
times 78 db 32 |
db 186 |
} |
d80x25: line_full_top |
line_space |
line_space |
line_half |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
db 186,' Kolibri OS comes with ABSOLUTELY NO WARR' |
db 'ANTY; See file COPYING for details ',186 |
line_full_bottom |
novesa db "Display: EGA/CGA",13,10,0 |
vervesa db "Version of Vesa: Vesa x.x ",13,10,0 |
vervesa_off=22 |
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 Colors: [9] 320x200, " |
db "VGA 16 Colors: [0] 640x480",13,10 |
db 186," Select mode: ",0 |
bt24 db 13,10,186," Bits Per Pixel: 24",13,10,0 |
bt32 db 13,10,186," Bits Per Pixel: 32",13,10,0 |
vrrmprint db 13,10,186," 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 |
askmouse db " Mouse at:" |
db " [1] PS/2 (USB), [2] Com1, [3] Com2." |
db " Select port [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 13,10,186," Vesa 2.0+ : MTRR graphics acceleration " |
db "[1-yes/2-no] ? ",0 |
gr_direct db 186," Use direct LFB writing? " |
db "[1-yes/2-no] ? ",0 |
;mem_model db 13,10,186," Motherboard memory [1-16 Mb / 2-32 Mb / " |
; db "3-64Mb / 4-128 Mb / 5-256 Mb] ? ",0 |
bootlog db 13,10,186," After bootlog display [1-continue/2-pause] ? ",0 |
bdev db 13,10,186 |
db " Load ramdisk from [1-floppy; 2-C:\menuet.img (FAT32);" |
db 13,10,186," " |
db "3-use preloaded ram-image from kernel restart]: ",0 |
probetext db 13,10,13,10,186," Use standart graphics mode? [1-yes, " |
db "2-probe bios (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 |
prid db " pr.",0 |
prnotfnd db " pr. - not found.",0 |
modena db "Fatal - VBE 0x112+ required.",0 |
not386 db "Fatal - CPU 386+ required.",0 |
btns db 13,10,186,"Fatal - Can't determine color depth.",0 |
fatalsel db 13,10,"Fatal - Graphics mode not supported by hardware.",0 |
badsect db 13,10,186," Fatal - Bad sector. Replace floppy. ",0 |
memmovefailed db "Fatal - Int 0x15 move failed.",0 |
linef2 db 13,10 |
linef db 13,10,0 |
okt db " ... OK",0 |
keyin db "x",0 |
keyinbs db "x",8,0 |
diskload db 13,10,186," Loading diskette: 00 %",8,8,8,8,0 |
backspace db 8,0 |
pros db "00",8,8,0 |
leftpr db 186," ",0 |
boot_dev db 0 ; 0=floppy, 1=hd |
/kernel/trunk/boot/bootru.inc |
---|
0,0 → 1,110 |
;====================================================================== |
; |
; BOOT DATA |
; |
;====================================================================== |
macro line_full_top { |
db 201 |
times 78 db 205 |
db 187 |
} |
macro line_full_bottom { |
db 200 |
times 78 db 205 |
db 188 |
} |
macro line_half { |
db 186,' ' |
times 76 db 0xc4 |
db ' ',186 |
} |
macro line_space { |
db 186 |
times 78 db 32 |
db 186 |
} |
d80x25: line_full_top |
line_space |
line_space |
line_half |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
line_space |
db 186,' Kolibri OS ¥ ¯à¥¤®áâ ¢«ï¥â ¨ª ª¨å £ àa' |
db '⨩; ®¤à®¡¥¥ - á¬. GNU.TXT ',186 |
line_full_bottom |
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 13,10,186," «ã¡¨ 梥â : 24",13,10,0 |
bt32 db 13,10,186," «ã¡¨ 梥â : 32",13,10,0 |
vrrmprint db 13,10,186," ᯮ«ì§®¢ âì 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 13,10,186," 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 186 |
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 |
prid db " pr.",0 |
prnotfnd db " pr. - ®è¨¡ª .",0 |
modena db "訡ª - ॡã¥âáï ¯®¤¤¥à¦ª VBE 0x112+.",0 |
not386 db "訡ª - ॡã¥âáï ¯à®æ¥áá®à 386+.",0 |
btns db 13,10,186," 訡ª - ¥ ¬®£ã ®¯à¥¤¥«¨âì £«ã¡¨ã 梥â .",0 |
fatalsel db 13,10,"訡ª - ë¡à ë© ¢¨¤¥®à¥¦¨¬ ¥ ¯®¤¤¥à¦¨¢ ¥âáï.",0 |
badsect db 13,10,186," 訡ª - ¨áª¥â ¯®¢à¥¦¤¥ . ®¯à®¡ã©â¥ ¤àã£ãî. " |
db 0 |
memmovefailed db "Fatal - Int 0x15 move failed.",0 |
linef2 db 13,10 |
linef db 13,10,0 |
okt db " ... OK",0 |
keyin db "x",0 |
keyinbs db "x",8,0 |
diskload db 13,10,186," £à㧪 ¤¨áª¥âë: 00 %",8,8,8,8,0 |
backspace db 8,0 |
pros db "00",8,8,0 |
leftpr db 186," ",0 |
boot_dev db 0 |
/kernel/trunk/boot/preboot.inc |
---|
0,0 → 1,23 |
display_modechg db 0 ; display mode change for text, yes/no (0 or 2) |
; |
; !! Important note !! |
; |
; Must be set to 2, to avoid two screenmode |
; changes within a very short period of time. |
display_atboot db 0 ; show boot screen messages ( 2-no ) |
preboot_graph db 0 ; graph mode |
preboot_gprobe db 0 ; probe vesa3 videomodes (1-no, 2-yes) |
preboot_vrrm db 0 ; use VRR_M (1-yes, 2- no) |
;;preboot_mouse db 0 ; mouse port (1-PS2, 2-COM1, 3-COM2) |
preboot_mtrr db 0 ; mtrr acceleration (1-yes, 2-no) |
preboot_device db 0 ; boot device |
; (1-floppy 2-harddisk 3-kernel restart) |
;;preboot_memory db 0 ; amount of memory |
; (1-16Mb;2-32Mb;3-64Mb;4-128Mb;5-256Mb) |
; !!!! 0 - autodetect !!!! |
preboot_blogesc db 0 ; start immediately after bootlog |
hdsysimage db 'MENUET IMG' ; load from |
image_save db 'MENUET IMG' ; save to |
/kernel/trunk/boot/rdload.inc |
---|
0,0 → 1,95 |
; READ RAMDISK IMAGE FROM HD |
cmp [boot_dev],1 |
jne no_sys_on_hd |
test [0x40001],byte 0x40 |
jz position_2 |
mov [hdbase],0x1f0 |
mov [hdid],0x0 |
mov [hdpos],1 |
mov [fat32part],0 |
position_1_1: |
inc [fat32part] |
call search_and_read_image |
cmp [image_retrieved],1 |
je yes_sys_on_hd |
movzx eax,byte [0x40002] |
cmp [fat32part],eax |
jle position_1_1 |
position_2: |
test [0x40001],byte 0x10 |
jz position_3 |
mov [hdbase],0x1f0 |
mov [hdid],0x10 |
mov [hdpos],2 |
mov [fat32part],0 |
position_2_1: |
inc [fat32part] |
call search_and_read_image |
cmp [image_retrieved],1 |
je yes_sys_on_hd |
movzx eax,byte [0x40003] |
cmp eax,[fat32part] |
jle position_2_1 |
position_3: |
test [0x40001],byte 0x4 |
jz position_4 |
mov [hdbase],0x170 |
mov [hdid],0x0 |
mov [hdpos],3 |
mov [fat32part],0 |
position_3_1: |
inc [fat32part] |
call search_and_read_image |
cmp [image_retrieved],1 |
je yes_sys_on_hd |
movzx eax,byte [0x40004] |
cmp eax,[fat32part] |
jle position_3_1 |
position_4: |
test [0x40001],byte 0x1 |
jz no_sys_on_hd |
mov [hdbase],0x170 |
mov [hdid],0x10 |
mov [hdpos],4 |
mov [fat32part],0 |
position_4_1: |
inc [fat32part] |
call search_and_read_image |
cmp [image_retrieved],1 |
je yes_sys_on_hd |
movzx eax,byte [0x40005] |
cmp eax,[fat32part] |
jle position_4_1 |
jmp yes_sys_on_hd |
search_and_read_image: |
; mov [0xfe10],dword 0 ; entries in hd cache |
call set_FAT32_variables |
mov edx, bootpath |
call read_image |
test eax, eax |
jz image_present |
mov edx, bootpath2 |
call read_image |
test eax, eax |
jz image_present |
ret |
image_present: |
mov [image_retrieved],1 |
ret |
read_image: |
mov eax, hdsysimage |
mov ebx, 1474560/512 |
mov ecx, 0x100000 |
mov esi, 0 |
mov edi, 12 |
call file_read |
ret |
image_retrieved db 0 |
counter_of_partitions db 0 |
no_sys_on_hd: |
yes_sys_on_hd: |
/kernel/trunk/boot/ru.inc |
---|
0,0 → 1,92 |
; Generated by RUFNT.EXE |
; By BadBugsKiller (C) |
; Modifyed by BadBugsKiller 12.01.2004 17:45 |
; Øðèôò óìåíüøåí â ðàçìåðå è òåïåðü ñîñòîèò èç 2-óõ ÷àñòåé, |
; ñîäåðæàùèõ òîëüêî ñèìâîëû ðóññêîãî àëôàâèòà. |
; ñèìâîëû â êîäèðîâêå ASCII (ÄÎÑ'îâñêàÿ), êîäîâàÿ ñòàíèöà 866. |
RU_FNT1: |
db 0x00, 0x00, 0x1E, 0x36, 0x66, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0xFE, 0x62, 0x60, 0x60, 0x7C, 0x66, 0x66, 0x66, 0x66, 0xFC, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0xFC, 0x66, 0x66, 0x66, 0x7C, 0x66, 0x66, 0x66, 0x66, 0xFC, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0xFE, 0x66, 0x62, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x1E, 0x36, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0xFF, 0xC3, 0x81, 0x00, 0x00 |
db 0x00, 0x00, 0xFE, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xFE, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0xDB, 0xDB, 0x5A, 0x5A, 0x7E, 0x7E, 0x5A, 0xDB, 0xDB, 0xDB, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x7C, 0xC6, 0x06, 0x06, 0x3C, 0x06, 0x06, 0x06, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xCE, 0xDE, 0xF6, 0xE6, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00 |
db 0x6C, 0x38, 0xC6, 0xC6, 0xC6, 0xCE, 0xDE, 0xF6, 0xE6, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0xE6, 0x66, 0x6C, 0x6C, 0x78, 0x78, 0x6C, 0x6C, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x1F, 0x36, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0xCF, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0xC6, 0xEE, 0xFE, 0xFE, 0xD6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0xFE, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0xFC, 0x66, 0x66, 0x66, 0x66, 0x7C, 0x60, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC0, 0xC0, 0xC0, 0xC0, 0xC2, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0xFF, 0xDB, 0x99, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0x06, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x7E, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x7E, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0xC6, 0xC6, 0x6C, 0x7C, 0x38, 0x38, 0x7C, 0x6C, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xFF, 0x03, 0x03, 0x00, 0x00 |
db 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xFE, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xFF, 0x03, 0x03, 0x00, 0x00 |
db 0x00, 0x00, 0xF8, 0xF0, 0xB0, 0x30, 0x3E, 0x33, 0x33, 0x33, 0x33, 0x7E, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0xC3, 0xC3, 0xC3, 0xC3, 0xF3, 0xDB, 0xDB, 0xDB, 0xDB, 0xF3, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0xF0, 0x60, 0x60, 0x60, 0x7C, 0x66, 0x66, 0x66, 0x66, 0xFC, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x7C, 0xC6, 0x06, 0x26, 0x3E, 0x26, 0x06, 0x06, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0xCE, 0xDB, 0xDB, 0xDB, 0xFB, 0xDB, 0xDB, 0xDB, 0xDB, 0xCE, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x3F, 0x66, 0x66, 0x66, 0x3E, 0x3E, 0x66, 0x66, 0x66, 0xE7, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x02, 0x06, 0x7C, 0xC0, 0xC0, 0xFC, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x66, 0x66, 0x7C, 0x66, 0x66, 0xFC, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x62, 0x62, 0x60, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x36, 0x66, 0x66, 0x66, 0x66, 0xFF, 0xC3, 0xC3, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xFE, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0xD6, 0xD6, 0x54, 0x7C, 0x54, 0xD6, 0xD6, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0x06, 0x3C, 0x06, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0xCE, 0xD6, 0xE6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x6C, 0x38, 0xC6, 0xC6, 0xCE, 0xD6, 0xE6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0xE6, 0x6C, 0x78, 0x78, 0x6C, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x36, 0x66, 0x66, 0x66, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xEE, 0xFE, 0xFE, 0xD6, 0xD6, 0xC6, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00 |
RU_FNT2: |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0xDC, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7C, 0x60, 0x60, 0xF0, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC0, 0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x5A, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0x06, 0xC6, 0x7C, 0x00 |
db 0x00, 0x00, 0x00, 0x3C, 0x18, 0x7E, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x7E, 0x18, 0x18, 0x3C, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0x6C, 0x38, 0x38, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xFF, 0x03, 0x03, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xFE, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xFE, 0x03, 0x03, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xB0, 0xB0, 0x3E, 0x33, 0x33, 0x7E, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xF6, 0xDE, 0xDE, 0xF6, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x60, 0x60, 0x7C, 0x66, 0x66, 0xFC, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0x06, 0x3E, 0x06, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0xCE, 0xDB, 0xDB, 0xFB, 0xDB, 0xDB, 0xCE, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xC6, 0xC6, 0x7E, 0x36, 0x66, 0xE7, 0x00, 0x00, 0x00, 0x00 |
db 0x6C, 0x00, 0xFE, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xFE, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x6C, 0x00, 0x7C, 0xC6, 0xC6, 0xFC, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x7C, 0xC6, 0xC0, 0xC8, 0xF8, 0xC8, 0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC0, 0xF8, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00 |
db 0x66, 0x00, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x6C, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00 |
db 0x6C, 0x38, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0x06, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x6C, 0x38, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0x06, 0xC6, 0x7C, 0x00 |
db 0x00, 0x38, 0x6C, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x0E, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0xEC, 0x6C, 0x3C, 0x1C, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0xCF, 0xCD, 0xEF, 0xEC, 0xFF, 0xDC, 0xDC, 0xCC, 0xCC, 0xCC, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0xC6, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0xC6, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 |
/kernel/trunk/boot/shutdown.inc |
---|
0,0 → 1,496 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; |
;; Shutdown for Menuet |
;; |
;; Distributed under General Public License |
;; See file COPYING for details. |
;; Copyright 2003 Ville Turjanmaa |
;; |
system_shutdown: ; shut down the system |
mov eax,3 ; stop playing cd |
call sys_cd_audio |
cli |
cld |
mov al,[0x2f0000+0x9030] |
cmp al,1 |
jl no_shutdown_parameter |
cmp al,4 |
jg no_shutdown_parameter |
jmp yes_shutdown_param |
no_shutdown_parameter: |
movzx ecx,word [0x2f0000+0x900A] |
movzx esi,word [0x2f0000+0x900C] |
imul ecx,esi ;[0xfe04] |
; mov ecx,0x500000/4 ;3fff00/4 ; darken screen |
push ecx |
mov esi,[0xfe80] |
cmp esi,32*0x100000 |
jbe no_darken_screen |
mov edi,16*0x100000 |
sdnewpix: |
mov eax,[esi] |
add esi,4 |
shr eax,1 |
and eax,0x7f7f7f7f |
stosd |
loop sdnewpix |
pop ecx |
mov esi,16*0x100000 |
mov edi,[0xfe80] |
cld |
rep movsd |
no_darken_screen: |
mov eax,[0xfe00] |
shr eax,1 |
sub eax,220 |
mov ebx,[0xfe04] |
shr ebx,1 |
mov [shutdownpos],ebx |
sub ebx,120 |
mov edi,1 |
mov ecx,0x0000ff |
sdnewpix2: |
call [putpixel] |
inc eax |
mov esi,[0xfe00] |
shr esi,1 |
add esi,220 |
cmp eax,esi |
jnz sdnewpix2 |
dec ecx |
mov eax,[0xfe00] |
shr eax,1 |
sub eax,220 |
inc ebx |
mov edx,[shutdownpos] |
add edx,105 |
cmp ebx,edx |
jnz sdnewpix2 |
mov esi,[0xfe00] ; menuet version |
shr esi,1 |
sub esi,220 |
add esi,27 |
shl esi,16 |
mov eax,esi |
add eax,[shutdownpos] |
sub eax,105 |
mov ebx,0xffff00 |
mov ecx,version |
mov edx,34 |
mov edi,1 |
call dtext |
mov esi,[0xfe00] ; 'it is safe..' |
shr esi,1 |
sub esi,220 |
add esi,27 |
shl esi,16 |
mov eax,esi |
add eax,[shutdownpos] |
add eax,33 |
mov esi,6 |
mov ebx,0xffffff |
mov ecx,shutdowntext |
mov edx,40 |
mov edi,1 |
newsdt: |
call dtext |
add eax,10 |
add ecx,40 |
dec esi |
jnz newsdt |
mov eax,rosef ; load rose.txt |
mov ebx,0 |
mov ecx,16800 |
mov edx,0x90000 |
mov esi,12 |
call fileread |
mov esi,[0xfe00] ; draw rose |
shr esi,1 |
add esi,20 |
shl esi,16 |
mov eax,esi |
add eax,[shutdownpos] |
sub eax,110 |
mov ebx,0x00ff00 |
mov ecx,0x90001 |
mov edx,27 |
mov edi,1 |
nrl: |
call dtext |
sub ebx,0x050000 |
add eax,8 |
add ecx,31 |
cmp ecx,dword 0x90001+25*31 |
jnz nrl |
call checkEgaCga |
yes_shutdown_param: |
cli |
mov eax,kernel ; load kernel.mnt to 0x8000:0 |
mov esi,12 |
mov ebx,0 |
mov ecx,-1 |
mov edx,0x80000 |
call fileread |
mov esi,restart_kernel_4000 ; move kernel re-starter to 0x4000:0 |
mov edi,0x40000 |
mov ecx,1000 |
cld |
rep movsb |
mov eax,0x2F0000 ; restore 0x0 - 0xffff |
mov ebx,0x0000 |
mov ecx,0xffff |
call memmove |
call restorefatchain |
mov eax,pr_mode_exit |
mov [0x467+0],ax |
mov [0x467+2],word 0x1000 |
mov al,0x0F |
out 0x70,al |
mov al,0x05 |
out 0x71,al |
mov al,0xFE |
out 0x64,al |
hlt |
use16 |
pr_mode_exit: |
mov ax,1000 |
mov ds,ax |
mov es,ax |
mov fs,ax |
mov gs,ax |
mov ss,ax |
; mov bl,[shutdown_parameter] |
mov al,2 |
out 0x21,al |
mov al,0 |
out 0xA1,al |
; mov [es:shutdown_parameter-0x10000],bl |
jmp real_mode-0x10000 |
old_ints_h: |
dw 4*0x20 |
dd 0 |
dw 0 |
real_mode: |
lidt [cs:old_ints_h-0x10000] |
mov sp,0xfff0 |
sti |
jmp temp_3456 |
nbw: |
xor ax,ax |
in al,0x60 |
call pause_key |
cmp al,7 |
jge nbw |
mov bl,al |
nbw2: |
in al,0x60 |
call pause_key |
cmp al,bl |
je nbw2 |
cmp al,240 ;ax,240 |
jne nbw31 |
mov al,bl |
dec al |
jmp nbw32 |
nbw31: |
add bl,128 |
cmp al,bl |
jne nbw |
sub al,129 |
nbw32: |
cmp al,1 ; write floppy |
jne no_floppy_write |
call floppy_write |
jmp temp_3456 ;nbw |
no_floppy_write: |
cmp al,2 ; poweroff |
jne no_apm_off |
call APM_PowerOff |
no_apm_off: |
cmp al,3 ; boot |
jnz no_sys_boot |
mov ax,0x0040 |
mov ds,ax |
mov word[0x0072],0x1234 |
jmp 0xF000:0xFFF0 |
no_sys_boot: |
cmp al,4 ; restart kernel |
je restart_kernel |
temp_3456: |
push word 0x0000 |
pop es |
mov al,byte [es:0x9030] |
cmp al,1 |
jl nbw |
cmp al,4 |
jg nbw |
jmp nbw32 |
; jmp nbw |
pause_key: |
mov ecx,100 |
pause_key_1: |
loop pause_key_1 |
ret |
iglobal |
kernel db 'KERNEL MNT' |
; shutdown_parameter db 0 |
endg |
restart_kernel: |
mov ax,0x0003 ; set text mode for screen |
int 0x10 |
jmp 0x4000:0000 |
restart_kernel_4000: |
mov di,0x1000 ; load kernel image from 0x8000:0 -> 0x1000:0 |
new_kernel_block_move: |
mov ebx,0 |
new_kernel_byte_move: |
mov ax,di |
add ax,0x7000 |
mov es,ax |
mov dl,[es:bx] |
mov es,di |
mov [es:bx],dl |
inc ebx |
cmp ebx,65536 |
jbe new_kernel_byte_move |
add di,0x1000 |
cmp di,0x2000 |
jbe new_kernel_block_move |
wbinvd ; write and invalidate cache |
mov ax,0x1000 |
mov es,ax |
mov ax,0x2000 |
mov ss,ax |
mov sp,0xff00 |
jmp 0x1000:0000 |
APM_PowerOff: |
;!!!!!!!!!!!!!!!!!!!!!!!! |
mov ax,0x5300 |
xor bx,bx |
int 0x15 |
push ax |
mov ax,0x5301 |
xor bx,bx |
int 0x15 |
mov ax,0x5308 |
mov bx,1 |
mov cx,bx |
int 0x15 |
mov ax,0x530E |
xor bx,bx |
pop cx |
int 0x15 |
mov ax,0x530D |
mov bx,1 |
mov cx,bx |
int 0x15 |
mov ax,0x530F |
mov bx,1 |
mov cx,bx |
int 0x15 |
mov ax,0x5307 |
mov bx,1 |
mov cx,3 |
int 0x15 |
;!!!!!!!!!!!!!!!!!!!!!!!! |
ret |
uglobal |
flm db 0 |
endg |
floppy_write: ; write diskette image to physical floppy |
pusha |
mov ax,0x1000 |
mov es,ax |
cmp [es:flm-0x10000],byte 1 |
je fwwritedone |
mov [es:flm-0x10000],byte 1 |
mov ax,0x0000 ; reset drive |
mov dx,0x0000 |
int 0x13 |
mov cx,0x0001 ; startcyl,startsector |
mov dx,0x0000 ; starthead,drive |
push word 80*2 ; read no of sect |
fwwrites: |
pusha |
; move 1mb+ -> 0:a000 |
pusha |
mov si,fwmovedesc -0x10000 |
push word 0x1000 |
pop es |
mov cx,256*18 |
mov ah,0x87 |
int 0x15 |
mov eax,[es:fwmovedesc-0x10000+0x12] |
add eax,512*18 |
mov [es:fwmovedesc-0x10000+0x12],eax |
popa |
xor si,si |
fwnewwrite: |
push word 0x0 |
pop es |
mov bx,0xa000 ; es:bx -> data area |
mov ax,0x0300+18 ; read, no of sectors to read |
int 0x13 |
cmp ah,0 |
jz fwgoodwrite |
add si,1 |
cmp si,10 |
jnz fwnewwrite |
add esp,32+2 |
popa ; can't access diskette |
ret |
fwgoodwrite: |
popa |
inc dh |
cmp dh,2 |
jnz fwbb2 |
mov dh,0 |
inc ch |
fwbb2: |
cld |
pop ax |
dec ax |
push ax |
cmp ax,0 |
jnz fwrs |
pop ax |
jmp fwwritedone |
fwrs: |
jmp fwwrites |
fwmovedesc: |
db 0x00,0x00,0x0,0x00,0x00,0x00,0x0,0x0 |
db 0x00,0x00,0x0,0x00,0x00,0x00,0x0,0x0 |
db 0xff,0xff,0x0,0x00,0x10,0x93,0x0,0x0 |
db 0xff,0xff,0x0,0xa0,0x00,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 |
fwwritedone: |
popa |
ret |
use32 |
uglobal |
shutdownpos dd 0x0 |
endg |
iglobal |
;shutdowntext: |
; db "IT'S SAFE TO POWER OFF COMPUTER OR " |
; db ' ' |
; db '1) SAVE RAMDISK TO FLOPPY ' |
; db '2) APM - POWEROFF ' |
; db '3) REBOOT ' |
; db '4) RESTART KERNEL ' |
shutdowntext: |
db "¥§®¯ ᮥ ¢ëª«î票¥ ª®¬¯ìîâ¥à ¨«¨ " |
db ' ' |
db '1) ®åà ¨âì à ¬¤¨áª ¤¨áª¥âã ' |
db '2) APM - ¢ëª«î票¥ ¯¨â ¨ï ' |
db '3) ¥à¥§ £à㧪 á¨á⥬ë ' |
db '4) ¥áâ àâ ï¤à ¨§ ' |
rosef: |
db 'ROSE TXT' |
endg |