forked from KolibriOS/kolibrios
Removing deprecated branch "hd_kolibri"
The same can be achieved on trunk kolibri by using the "/sys" path. A backup of the files can be found on the KolibriOS FTP server. git-svn-id: svn://kolibrios.org@2928 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
ed2d3499be
commit
54202798c2
Binary file not shown.
@ -1,24 +0,0 @@
|
||||
AA-SYSXTREE-004-/hd0/1/kolibri/bin/sysxtree - *
|
||||
AB-COPY -008-/hd0/1/kolibri/bin/copy2 - *
|
||||
BB-CALC -006-/hd0/1/kolibri/bin/calc - *
|
||||
CA-TINYPAD -011-/hd0/1/kolibri/bin/tinypad - *
|
||||
CB-TINYPAD2-011-/hd0/1/kolibri/tinypad2 - *
|
||||
JA-VRR -009-/hd0/1/kolibri/bin/vrr - *
|
||||
II-C4 -005-/hd0/1/kolibri/bin/c4 - *
|
||||
JI-MINE -017-/hd0/1/kolibri/bin/mine - *
|
||||
IH-TETRIS -021-/hd0/1/kolibri/bin/tetris - *
|
||||
JH-MBLOCKS -013-/hd0/1/kolibri/bin/mblocks - *
|
||||
HI-PONG -026-/hd0/1/kolibri/bin/pong3 - *
|
||||
GI-15 -000-/hd0/1/kolibri/bin/15 - *
|
||||
HH-LIFE2 -015-/hd0/1/kolibri/bin/life2 - *
|
||||
BA-FASM -012-/hd0/1/kolibri/bin/fasm - *
|
||||
JB-ANIMAGE -018-/hd0/1/kolibri/bin/animage - *
|
||||
CC-CMD -023-/hd0/1/kolibri/bin/cmd - *
|
||||
IA-BOARD -022-/hd0/1/kolibri/bin/board - *
|
||||
BC-KFAR -027-/hd0/1/kolibri/bin/kfar/kfar - *
|
||||
HA-MTDBG -029-/hd0/1/kolibri/bin/mtdbg - *
|
||||
AH-PIPES -030-/hd0/1/kolibri/bin/pipes - *
|
||||
AI-FARA -031-/hd0/1/kolibri/bin/fara - *
|
||||
BI-ARC-II -014-/hd0/1/kolibri/bin/arcanii - *
|
||||
BH-XONIX -024-/hd0/1/kolibri/bin/xonix - *
|
||||
GH-CHECKERS-002-/hd0/1/kolibri/bin/checkers - *
|
@ -1,5 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix en >lang.inc
|
||||
@fasm icon.asm icon
|
||||
@erase lang.inc
|
||||
@pause
|
@ -1,5 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix ge >lang.inc
|
||||
@fasm icon.asm icon
|
||||
@erase lang.inc
|
||||
@pause
|
@ -1,5 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix ru >lang.inc
|
||||
@fasm icon.asm icon
|
||||
@erase lang.inc
|
||||
@pause
|
@ -1,328 +0,0 @@
|
||||
; GIF LITE v2.0 by Willow
|
||||
; Written in pure assembler by Ivushkin Andrey aka Willow
|
||||
;
|
||||
; This include file will contain functions to handle GIF image format
|
||||
;
|
||||
; Created: August 15, 2004
|
||||
; Last changed: September 9, 2004
|
||||
|
||||
; Change COLOR_ORDER in your program
|
||||
; if colors are displayed improperly
|
||||
|
||||
if ~ (COLOR_ORDER in <MENUETOS,OTHER>)
|
||||
; This message may not appear under MenuetOS, so watch...
|
||||
display 'Please define COLOR_ORDER: MENUETOS or OTHER',13,10
|
||||
end if
|
||||
|
||||
; virtual structure, used internally
|
||||
|
||||
struc GIF_list
|
||||
{
|
||||
.NextImg rd 1
|
||||
.Left rw 1
|
||||
.Top rw 1
|
||||
.Width rw 1
|
||||
.Height rw 1
|
||||
}
|
||||
|
||||
struc GIF_info
|
||||
{
|
||||
.Left rw 1
|
||||
.Top rw 1
|
||||
.Width rw 1
|
||||
.Height rw 1
|
||||
}
|
||||
|
||||
_null fix 0x1000
|
||||
|
||||
; ****************************************
|
||||
; FUNCTION GetGIFinfo - retrieve Nth image info
|
||||
; ****************************************
|
||||
; in:
|
||||
; esi - pointer to image list header
|
||||
; ecx - image_index (0...img_count-1)
|
||||
; edi - pointer to GIF_info structure to be filled
|
||||
|
||||
; out:
|
||||
; eax - pointer to RAW data, or 0, if error
|
||||
|
||||
GetGIFinfo:
|
||||
push esi ecx edi
|
||||
xor eax,eax
|
||||
jecxz .eloop
|
||||
.lp:
|
||||
mov esi,[esi]
|
||||
test esi,esi
|
||||
jz .error
|
||||
loop .lp
|
||||
.eloop:
|
||||
add esi,4
|
||||
movsd
|
||||
movsd
|
||||
mov eax,esi
|
||||
.error:
|
||||
pop edi ecx esi
|
||||
ret
|
||||
|
||||
; ****************************************
|
||||
; FUNCTION ReadGIF - unpacks GIF image
|
||||
; ****************************************
|
||||
; in:
|
||||
; esi - pointer to GIF file in memory
|
||||
; edi - pointer to output image list
|
||||
; eax - pointer to work area (MIN 16 KB!)
|
||||
|
||||
; out:
|
||||
; eax - 0, all OK;
|
||||
; eax - 1, invalid signature;
|
||||
; eax >=8, unsupported image attributes
|
||||
;
|
||||
; ecx - number of images
|
||||
|
||||
ReadGIF:
|
||||
push esi edi
|
||||
mov [.table_ptr],eax
|
||||
mov [.cur_info],edi
|
||||
xor eax,eax
|
||||
mov [.globalColor],eax
|
||||
mov [.img_count],eax
|
||||
inc eax
|
||||
cmp dword[esi],'GIF8'
|
||||
jne .er ; signature
|
||||
mov ecx,[esi+0xa]
|
||||
inc eax
|
||||
add esi,0xd
|
||||
mov edi,esi
|
||||
bt ecx,7
|
||||
jnc .nextblock
|
||||
mov [.globalColor],esi
|
||||
call .Gif_skipmap
|
||||
.nextblock:
|
||||
cmp byte[edi],0x21
|
||||
jne .noextblock
|
||||
inc edi
|
||||
cmp byte[edi],0xf9 ; Graphic Control Ext
|
||||
jne .no_gc
|
||||
add edi,7
|
||||
jmp .nextblock
|
||||
.no_gc:
|
||||
cmp byte[edi],0xfe ; Comment Ext
|
||||
jne .no_comm
|
||||
inc edi
|
||||
.block_skip:
|
||||
movzx eax,byte[edi]
|
||||
lea edi,[edi+eax+1]
|
||||
cmp byte[edi],0
|
||||
jnz .block_skip
|
||||
inc edi
|
||||
jmp .nextblock
|
||||
.no_comm:
|
||||
cmp byte[edi],0xff ; Application Ext
|
||||
jne .nextblock
|
||||
add edi,13
|
||||
jmp .block_skip
|
||||
.noextblock:
|
||||
cmp byte[edi],0x2c ; image beginning
|
||||
jne .er
|
||||
inc [.img_count]
|
||||
inc edi
|
||||
mov esi,[.cur_info]
|
||||
add esi,4
|
||||
xchg esi,edi
|
||||
movsd
|
||||
movsd
|
||||
push edi
|
||||
movzx ecx,word[esi]
|
||||
inc esi
|
||||
bt ecx,7
|
||||
jc .uselocal
|
||||
push [.globalColor]
|
||||
mov edi,esi
|
||||
jmp .setPal
|
||||
.uselocal:
|
||||
call .Gif_skipmap
|
||||
push esi
|
||||
.setPal:
|
||||
movzx ecx,byte[edi]
|
||||
inc ecx
|
||||
mov [.codesize],ecx
|
||||
dec ecx
|
||||
pop [.Palette]
|
||||
lea esi,[edi+1]
|
||||
mov edi,[.table_ptr]
|
||||
xor eax,eax
|
||||
cld
|
||||
lodsb ; eax - block_count
|
||||
add eax,esi
|
||||
mov [.block_ofs],eax
|
||||
mov [.bit_count],8
|
||||
mov eax,1
|
||||
shl eax,cl
|
||||
mov [.CC],eax
|
||||
inc eax
|
||||
mov [.EOI],eax
|
||||
lea ecx,[eax-1]
|
||||
mov eax, _null shl 16
|
||||
.filltable:
|
||||
stosd
|
||||
inc eax
|
||||
loop .filltable
|
||||
pop edi
|
||||
mov [.img_start],edi
|
||||
.reinit:
|
||||
mov edx,[.EOI]
|
||||
inc edx
|
||||
push [.codesize]
|
||||
pop [.compsize]
|
||||
call .Gif_get_sym
|
||||
cmp eax,[.CC]
|
||||
je .reinit
|
||||
call .Gif_output
|
||||
.cycle:
|
||||
movzx ebx,ax
|
||||
call .Gif_get_sym
|
||||
cmp eax,edx
|
||||
jae .notintable
|
||||
cmp eax,[.CC]
|
||||
je .reinit
|
||||
cmp eax,[.EOI]
|
||||
je .end
|
||||
call .Gif_output
|
||||
.add:
|
||||
push eax
|
||||
mov eax,[.table_ptr]
|
||||
mov [eax+edx*4],ebx
|
||||
pop eax
|
||||
cmp edx,0xFFF
|
||||
jae .cycle
|
||||
inc edx
|
||||
bsr ebx,edx
|
||||
cmp ebx,[.compsize]
|
||||
jne .noinc
|
||||
inc [.compsize]
|
||||
.noinc:
|
||||
jmp .cycle
|
||||
.notintable:
|
||||
push eax
|
||||
mov eax,ebx
|
||||
call .Gif_output
|
||||
push ebx
|
||||
movzx eax,bx
|
||||
call .Gif_output
|
||||
pop ebx eax
|
||||
jmp .add
|
||||
.er:
|
||||
pop edi
|
||||
jmp .ex
|
||||
.end:
|
||||
mov eax,[.cur_info]
|
||||
mov [eax],edi
|
||||
mov [.cur_info],edi
|
||||
add esi,2
|
||||
xchg esi,edi
|
||||
.nxt:
|
||||
cmp byte[edi],0
|
||||
jnz .continue
|
||||
inc edi
|
||||
jmp .nxt
|
||||
.continue:
|
||||
cmp byte[edi],0x3b
|
||||
jne .nextblock
|
||||
xor eax,eax
|
||||
stosd
|
||||
mov ecx,[.img_count]
|
||||
.ex:
|
||||
pop edi esi
|
||||
ret
|
||||
|
||||
.Gif_skipmap:
|
||||
; in: ecx - image descriptor, esi - pointer to colormap
|
||||
; out: edi - pointer to area after colormap
|
||||
|
||||
and ecx,111b
|
||||
inc ecx ; color map size
|
||||
mov ebx,1
|
||||
shl ebx,cl
|
||||
lea ebx,[ebx*2+ebx]
|
||||
lea edi,[esi+ebx]
|
||||
ret
|
||||
|
||||
.Gif_get_sym:
|
||||
mov ecx,[.compsize]
|
||||
push ecx
|
||||
xor eax,eax
|
||||
.shift:
|
||||
ror byte[esi],1
|
||||
rcr eax,1
|
||||
dec [.bit_count]
|
||||
jnz .loop1
|
||||
inc esi
|
||||
cmp esi,[.block_ofs]
|
||||
jb .noblock
|
||||
push eax
|
||||
xor eax,eax
|
||||
lodsb
|
||||
test eax,eax
|
||||
jnz .nextbl
|
||||
mov eax,[.EOI]
|
||||
sub esi,2
|
||||
add esp,8
|
||||
jmp .exx
|
||||
.nextbl:
|
||||
add eax,esi
|
||||
mov [.block_ofs],eax
|
||||
pop eax
|
||||
.noblock:
|
||||
mov [.bit_count],8
|
||||
.loop1:
|
||||
loop .shift
|
||||
pop ecx
|
||||
rol eax,cl
|
||||
.exx:
|
||||
xor ecx,ecx
|
||||
ret
|
||||
|
||||
.Gif_output:
|
||||
push esi eax edx
|
||||
mov edx,[.table_ptr]
|
||||
.next:
|
||||
push word[edx+eax*4]
|
||||
mov ax,word[edx+eax*4+2]
|
||||
inc ecx
|
||||
cmp ax,_null
|
||||
jnz .next
|
||||
shl ebx,16
|
||||
mov bx,[esp]
|
||||
.loop2:
|
||||
pop ax
|
||||
|
||||
lea esi,[eax+eax*2]
|
||||
add esi,[.Palette]
|
||||
|
||||
if COLOR_ORDER eq MENUETOS
|
||||
mov esi,[esi]
|
||||
bswap esi
|
||||
shr esi,8
|
||||
mov [edi],esi
|
||||
add edi,3
|
||||
else
|
||||
movsw
|
||||
movsb
|
||||
end if
|
||||
|
||||
loop .loop2
|
||||
pop edx eax esi
|
||||
ret
|
||||
|
||||
.globalColor rd 1
|
||||
.img_count rd 1
|
||||
.cur_info rd 1 ; image table pointer
|
||||
.img_start rd 1
|
||||
.codesize rd 1
|
||||
.compsize rd 1
|
||||
.bit_count rd 1
|
||||
.CC rd 1
|
||||
.EOI rd 1
|
||||
.Palette rd 1
|
||||
.block_ofs rd 1
|
||||
.table_ptr rd 1
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 12 KiB |
@ -1,269 +0,0 @@
|
||||
; new application structure
|
||||
macro meos_app_start
|
||||
{
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
db 'MENUET01'
|
||||
dd 0x01
|
||||
dd __start
|
||||
dd __end
|
||||
dd __memory
|
||||
dd __stack
|
||||
|
||||
if used __params & ~defined __params
|
||||
dd __params
|
||||
else
|
||||
dd 0x0
|
||||
end if
|
||||
|
||||
dd 0x0
|
||||
}
|
||||
MEOS_APP_START fix meos_app_start
|
||||
|
||||
macro code
|
||||
{
|
||||
__start:
|
||||
}
|
||||
CODE fix code
|
||||
|
||||
macro data
|
||||
{
|
||||
__data:
|
||||
}
|
||||
DATA fix data
|
||||
|
||||
macro udata
|
||||
{
|
||||
if used __params & ~defined __params
|
||||
__params:
|
||||
db 0
|
||||
__end:
|
||||
rb 255
|
||||
else
|
||||
__end:
|
||||
end if
|
||||
__udata:
|
||||
}
|
||||
UDATA fix udata
|
||||
|
||||
macro meos_app_end
|
||||
{
|
||||
align 32
|
||||
rb 2048
|
||||
__stack:
|
||||
__memory:
|
||||
}
|
||||
MEOS_APP_END fix meos_app_end
|
||||
|
||||
|
||||
; macro for defining multiline text data
|
||||
struc mstr [sstring]
|
||||
{
|
||||
forward
|
||||
local ssize
|
||||
virtual at 0
|
||||
db sstring
|
||||
ssize = $
|
||||
end virtual
|
||||
dd ssize
|
||||
db sstring
|
||||
common
|
||||
dd -1
|
||||
}
|
||||
|
||||
|
||||
; strings
|
||||
macro sz name,[data] { ; from MFAR [mike.dld]
|
||||
common
|
||||
if used name
|
||||
label name
|
||||
end if
|
||||
forward
|
||||
if used name
|
||||
db data
|
||||
end if
|
||||
common
|
||||
if used name
|
||||
.size = $-name
|
||||
end if
|
||||
}
|
||||
|
||||
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
|
||||
common
|
||||
if used name
|
||||
label name
|
||||
end if
|
||||
forward
|
||||
if (used name)&(lang eq lng)
|
||||
db data
|
||||
end if
|
||||
common
|
||||
if used name
|
||||
.size = $-name
|
||||
end if
|
||||
}
|
||||
|
||||
|
||||
|
||||
; easy system call macro
|
||||
macro mpack dest, hsrc, lsrc
|
||||
{
|
||||
if (hsrc eqtype 0) & (lsrc eqtype 0)
|
||||
mov dest, (hsrc) shl 16 + lsrc
|
||||
else
|
||||
if (hsrc eqtype 0) & (~lsrc eqtype 0)
|
||||
mov dest, (hsrc) shl 16
|
||||
add dest, lsrc
|
||||
else
|
||||
mov dest, hsrc
|
||||
shl dest, 16
|
||||
add dest, lsrc
|
||||
end if
|
||||
end if
|
||||
}
|
||||
|
||||
macro __mov reg,a,b { ; mike.dld
|
||||
if (~a eq)&(~b eq)
|
||||
mpack reg,a,b
|
||||
else if (~a eq)&(b eq)
|
||||
mov reg,a
|
||||
end if
|
||||
}
|
||||
|
||||
macro mcall a,b,c,d,e,f { ; mike.dld
|
||||
__mov eax,a
|
||||
__mov ebx,b
|
||||
__mov ecx,c
|
||||
__mov edx,d
|
||||
__mov esi,e
|
||||
__mov edi,f
|
||||
int 0x40
|
||||
}
|
||||
|
||||
|
||||
|
||||
; optimize the code for size
|
||||
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
|
||||
|
||||
macro add arg1,arg2
|
||||
{
|
||||
if (arg2 eqtype 0)
|
||||
if (arg2) = 1
|
||||
inc arg1
|
||||
else
|
||||
add arg1,arg2
|
||||
end if
|
||||
else
|
||||
add arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
macro sub arg1,arg2
|
||||
{
|
||||
if (arg2 eqtype 0)
|
||||
if (arg2) = 1
|
||||
dec arg1
|
||||
else
|
||||
sub arg1,arg2
|
||||
end if
|
||||
else
|
||||
sub arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
macro mov arg1,arg2
|
||||
{
|
||||
if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
|
||||
if (arg2) = 0
|
||||
xor arg1,arg1
|
||||
else if (arg2) = 1
|
||||
xor arg1,arg1
|
||||
inc arg1
|
||||
else if (arg2) = -1
|
||||
or arg1,-1
|
||||
else if (arg2) > -128 & (arg2) < 128
|
||||
push arg2
|
||||
pop arg1
|
||||
else
|
||||
mov arg1,arg2
|
||||
end if
|
||||
else
|
||||
mov arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
|
||||
macro struct name
|
||||
{
|
||||
virtual at 0
|
||||
name name
|
||||
sizeof.#name = $ - name
|
||||
end virtual
|
||||
}
|
||||
|
||||
; structures used in MeOS
|
||||
struc process_information
|
||||
{
|
||||
.cpu_usage dd ? ; +0
|
||||
.window_stack_position dw ? ; +4
|
||||
.window_stack_value dw ? ; +6
|
||||
.not_used1 dw ? ; +8
|
||||
.process_name rb 12 ; +10
|
||||
.memory_start dd ? ; +22
|
||||
.used_memory dd ? ; +26
|
||||
.PID dd ? ; +30
|
||||
.x_start dd ? ; +34
|
||||
.y_start dd ? ; +38
|
||||
.x_size dd ? ; +42
|
||||
.y_size dd ? ; +46
|
||||
.slot_state dw ? ; +50
|
||||
dw ? ; +52 - reserved
|
||||
.client_left dd ? ; +54
|
||||
.client_top dd ? ; +58
|
||||
.client_width dd ? ; +62
|
||||
.client_height dd ? ; +66
|
||||
.wnd_state db ? ; +70
|
||||
rb (1024-71)
|
||||
}
|
||||
struct process_information
|
||||
|
||||
struc system_colors
|
||||
{
|
||||
.frame dd ?
|
||||
.grab dd ?
|
||||
.grab_button dd ?
|
||||
.grab_button_text dd ?
|
||||
.grab_text dd ?
|
||||
.work dd ?
|
||||
.work_button dd ?
|
||||
.work_button_text dd ?
|
||||
.work_text dd ?
|
||||
.work_graph dd ?
|
||||
}
|
||||
struct system_colors
|
||||
|
||||
|
||||
; constants
|
||||
|
||||
; events
|
||||
EV_IDLE = 0
|
||||
EV_TIMER = 0
|
||||
EV_REDRAW = 1
|
||||
EV_KEY = 2
|
||||
EV_BUTTON = 3
|
||||
EV_EXIT = 4
|
||||
EV_BACKGROUND = 5
|
||||
EV_MOUSE = 6
|
||||
EV_IPC = 7
|
||||
EV_STACK = 8
|
||||
|
||||
; event mask bits for function 40
|
||||
EVM_REDRAW = 1b
|
||||
EVM_KEY = 10b
|
||||
EVM_BUTTON = 100b
|
||||
EVM_EXIT = 1000b
|
||||
EVM_BACKGROUND = 10000b
|
||||
EVM_MOUSE = 100000b
|
||||
EVM_IPC = 1000000b
|
||||
EVM_STACK = 10000000b
|
@ -1,3 +0,0 @@
|
||||
echo lang fix en >lang.inc
|
||||
fasm jpegview.asm jpegview
|
||||
|
@ -1,77 +0,0 @@
|
||||
file_handler:
|
||||
.operation=0
|
||||
.position=4
|
||||
.reserved=8
|
||||
.n_bytes=12
|
||||
.bufer=16
|
||||
.name=20
|
||||
.st_size=20+1024
|
||||
|
||||
open: ;esi=name_string
|
||||
;retorna eax
|
||||
pushad
|
||||
mov ecx,file_handler.st_size
|
||||
call mallocz
|
||||
mov [esp+28],edi
|
||||
push edi
|
||||
mov ecx,1024
|
||||
add edi,file_handler.name
|
||||
call movedata
|
||||
pop edi
|
||||
; test if file exists
|
||||
lea ebx,[edi+file_handler.operation]
|
||||
mov byte[ebx],5
|
||||
mov dword[ebx+16],fileattr
|
||||
mov eax,70
|
||||
int 0x40
|
||||
cmp eax,2
|
||||
jz .virtual
|
||||
test eax,eax
|
||||
jnz close.b
|
||||
@@:
|
||||
clc
|
||||
popad
|
||||
ret
|
||||
.virtual:
|
||||
mov byte [fileattr], 0x10
|
||||
jmp @b
|
||||
|
||||
close:
|
||||
pushad
|
||||
.b:
|
||||
mov edi,[esp+28]
|
||||
call free
|
||||
popad
|
||||
xor eax,eax
|
||||
ret
|
||||
|
||||
|
||||
read: ;(f,bufer,nbytes) eax,edi,ecx ncr
|
||||
;retorna bytes leidos en ecx
|
||||
pushad
|
||||
lea ebx, [eax+file_handler.operation]
|
||||
mov byte [ebx], 0
|
||||
mov [ebx+12], ecx
|
||||
mov [ebx+16], edi
|
||||
mov eax, 70
|
||||
int 0x40
|
||||
cmp ebx, -1
|
||||
sbb ebx, -1
|
||||
mov eax, [esp+28]
|
||||
add [eax+file_handler.position], ebx
|
||||
mov [esp+24], ebx
|
||||
popad
|
||||
ret
|
||||
|
||||
ftell: mov edx,[eax+file_handler.position]
|
||||
ret
|
||||
lseek: ;eax=file edx=pos
|
||||
mov [eax+file_handler.position],edx
|
||||
ret
|
||||
skip: ;eax=file edx=bytes to skip
|
||||
add [eax+file_handler.position],edx
|
||||
ret
|
||||
|
||||
|
||||
|
||||
|
@ -1,22 +0,0 @@
|
||||
modes:
|
||||
dd mcu100,color100,8,8 ;monocromo
|
||||
dd mcu111,color111,8,8
|
||||
dd mcu211,color211,16,8
|
||||
dd mcu411,color411,16,16
|
||||
|
||||
zigzag:
|
||||
db 0,0, 4+1,0, 32,1, 64,1, 36,2, 8+1,0, 12+1,0, 40,4
|
||||
db 68,2, 96,1, 128,1, 100,2, 72,4, 44,8, 16+1,0, 20+1,0
|
||||
db 48,16, 76,8, 104,4, 132,2, 160,1, 192,1, 164,2, 136,4
|
||||
db 108,8, 80,16, 52,32, 24+1,0, 28+1,0, 56,64, 84,32, 112,16
|
||||
db 140,8, 168,4, 196,2, 224,1, 228,2, 200,4, 172,8, 144,16
|
||||
db 116,32, 88,64, 60,128, 92,128, 120,64, 148,32, 176,16, 204,8
|
||||
db 232,4, 236,8, 208,16, 180,32, 152,64, 124,128, 156,128, 184,64
|
||||
db 212,32, 240,16, 244,32, 216,64, 188,128, 220,128, 248,64, 252,128
|
||||
|
||||
k:
|
||||
dd 1.41421,1.84776,1.08239,-2.6131
|
||||
k2:
|
||||
dd 0.3535534,0.49039264,0.46193953,0.415734806
|
||||
dd 0.3535534,0.277785116,0.191341716,0.0975451609
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,545 +0,0 @@
|
||||
; IMGVIEW.ASM
|
||||
;
|
||||
; This program displays jpeg images. The window can be resized.
|
||||
;
|
||||
; Version 0.0 END OF 2003
|
||||
; Octavio Vega
|
||||
; Version 0.1 7th March 2004
|
||||
; Mike Hibbett ( very small part! )
|
||||
; Version 0.11 7th April 2004
|
||||
; Ville Turjanmaa ( 'set_as_bgr' function )
|
||||
; Version 0.12 29th May 2004
|
||||
; Ivan Poddubny (correct "set_as_bgr"+parameters+boot+...)
|
||||
; Version 0.12 30 de mayo 2004
|
||||
; Octavio Vega
|
||||
; bugs correction and slideshow
|
||||
; version 0.13 3 de junio 2004
|
||||
; Octavio Vega
|
||||
; unos retoques
|
||||
; version 0.14 10th August 2004
|
||||
; Mike Hibbett Added setting default colours
|
||||
; version 0.15 24th August 2006
|
||||
; diamond (rewritten to function 70)
|
||||
;
|
||||
|
||||
memsize=20000h
|
||||
org 0
|
||||
PARAMS = memsize - 1024
|
||||
|
||||
appname equ 'Jpegview '
|
||||
version equ '0.15'
|
||||
|
||||
use32
|
||||
|
||||
db 'MENUET01' ; 8 byte id
|
||||
dd 0x01 ; header version
|
||||
dd START ; start of code
|
||||
dd I_END ; size of image
|
||||
dd memsize ; memory for app
|
||||
dd memsize - 1024 ; esp
|
||||
dd PARAMS , 0x0 ; I_Param , I_Icon
|
||||
|
||||
stack_size=4096 + 1024
|
||||
|
||||
include 'macros.inc'
|
||||
|
||||
START: ; start of execution
|
||||
|
||||
cmp [PARAMS], byte 0
|
||||
jne check_parameters
|
||||
|
||||
; Calculate the 'free' memory available
|
||||
; to the application, and create the malloc block from it
|
||||
.l1:
|
||||
mov ecx,memsize-fin-stack_size
|
||||
mov edi,fin
|
||||
call add_mem
|
||||
|
||||
call colorprecalc ;inicializa tablas usadas para pasar de ybr a bgr
|
||||
call draw_window
|
||||
call read_string.rs_done
|
||||
|
||||
still:
|
||||
push still
|
||||
mov ebx,100 ;1 second
|
||||
mov eax,23 ; wait here for event
|
||||
int 0x40
|
||||
cmp eax,1 ; redraw request ?
|
||||
je draw_window
|
||||
cmp eax,2 ; key in buffer ?
|
||||
je read_string
|
||||
cmp eax,3 ; button in buffer ?
|
||||
je button
|
||||
jmp display_next
|
||||
|
||||
button: ; BUTTON
|
||||
mov eax,17
|
||||
int 0x40
|
||||
cmp ah,3
|
||||
je set_as_bgr2
|
||||
cmp ah,2
|
||||
je slideshow
|
||||
cmp ah,1 ; CLOSE PROGRAM
|
||||
jne close_program.exit
|
||||
close_program:
|
||||
mov eax,-1
|
||||
int 0x40
|
||||
.exit:
|
||||
ret
|
||||
|
||||
; Put a 'chunk' of the image on the window
|
||||
put_image:
|
||||
pushad
|
||||
|
||||
lea ebp,[edx+eax+7]
|
||||
cmp [winxs],bp
|
||||
jc .l1
|
||||
lea ebp,[ecx+ebx+20+2+17]
|
||||
cmp [winys],bp
|
||||
jc .l1
|
||||
|
||||
add eax,2 ; offset for boarder
|
||||
add ebx,2 ; offset for title bar
|
||||
push ax ; pox
|
||||
push bx ; pos
|
||||
push cx ; size
|
||||
push dx ; size
|
||||
pop ecx
|
||||
pop edx
|
||||
mov ebx,edi
|
||||
mov eax,7
|
||||
|
||||
int 40h ; Put image function
|
||||
.l1:
|
||||
popad
|
||||
ret
|
||||
|
||||
|
||||
|
||||
;******************************************************************************
|
||||
|
||||
check_parameters:
|
||||
cmp [PARAMS], dword "BOOT" ; received BOOT parameter -> goto handler
|
||||
je boot_set_background
|
||||
|
||||
mov edi, name_string ; clear string with file name
|
||||
mov al, 0
|
||||
mov ecx, 100
|
||||
rep stosb
|
||||
|
||||
mov ecx, 100 ; calculate length of parameter string
|
||||
mov edi, PARAMS
|
||||
repne scasb
|
||||
sub edi, PARAMS
|
||||
mov ecx, edi
|
||||
|
||||
mov esi, PARAMS ; copy parameters to file name
|
||||
mov edi, name_string
|
||||
cld
|
||||
rep movsb
|
||||
|
||||
jmp START.l1 ; return to beggining of the progra
|
||||
|
||||
;******************************************************************************
|
||||
|
||||
|
||||
|
||||
boot_set_background:
|
||||
|
||||
mov ecx,memsize-fin-stack_size ; size
|
||||
mov edi,fin ; pointer
|
||||
call add_mem ; mark memory from fin to 0x100000-1024 as free
|
||||
call colorprecalc ; calculate colors
|
||||
mov esi,name_string
|
||||
call open
|
||||
test eax,eax
|
||||
jz close_program
|
||||
call jpeg_info
|
||||
mov dword [jpeg_st],ebp
|
||||
call set_as_bgr2 ; set wallpaper
|
||||
jmp close_program ; close the program right now
|
||||
|
||||
;******************************************************************************
|
||||
;******************************************************************************
|
||||
|
||||
set_as_bgr2:
|
||||
mov ebp,dword[jpeg_st]
|
||||
test ebp,ebp
|
||||
jz .end
|
||||
|
||||
mov dword [ebp+draw_ptr],put_chunk_to_bgr
|
||||
call jpeg_display
|
||||
mov eax, 15
|
||||
mov ebx, 1
|
||||
mov ecx, [ebp + x_size]
|
||||
mov edx, [ebp + y_size]
|
||||
int 0x40
|
||||
|
||||
; Stretch the image to fit
|
||||
mov eax, 15
|
||||
mov ebx, 4
|
||||
mov ecx, 2
|
||||
int 0x40
|
||||
|
||||
mov eax, 15
|
||||
mov ebx, 3
|
||||
int 0x40
|
||||
|
||||
|
||||
.end:
|
||||
ret
|
||||
|
||||
;******************************************************************************
|
||||
|
||||
put_chunk_to_bgr:
|
||||
pushad
|
||||
|
||||
mov [x_pointer], edi
|
||||
mov esi, ecx
|
||||
imul esi, 3
|
||||
mov [x_numofbytes], esi
|
||||
mov ecx, [ebp + x_size]
|
||||
imul ecx, ebx
|
||||
add ecx, eax
|
||||
imul ecx, 3
|
||||
mov [x_offset], ecx
|
||||
mov [x_counter], edx
|
||||
mov eax, [ebp + x_size]
|
||||
imul eax, 3
|
||||
mov [x_numofb2], eax
|
||||
.new_string:
|
||||
mov eax, 15
|
||||
mov ebx, 5
|
||||
mov ecx, [x_pointer]
|
||||
mov edx, [x_offset]
|
||||
mov esi, [x_numofbytes]
|
||||
int 0x40
|
||||
mov eax, [x_numofbytes]
|
||||
add [x_pointer], eax
|
||||
mov eax, [x_numofb2]
|
||||
add [x_offset], eax
|
||||
dec [x_counter]
|
||||
jnz .new_string
|
||||
|
||||
popad
|
||||
ret
|
||||
|
||||
;******************************************************************************
|
||||
|
||||
|
||||
|
||||
; *********************************************
|
||||
; ******* WINDOW DEFINITIONS AND DRAW ********
|
||||
; *********************************************
|
||||
|
||||
|
||||
draw_window:
|
||||
|
||||
mov eax,48
|
||||
mov ebx,3
|
||||
mov ecx,sc
|
||||
mov edx,sizeof.system_colors
|
||||
int 0x40
|
||||
|
||||
mov eax,12
|
||||
mov ebx,1
|
||||
int 0x40
|
||||
|
||||
; Draw the window to the appropriate size - it may have
|
||||
; been resized by the user
|
||||
cmp [winxs], 0
|
||||
jne dw_001
|
||||
|
||||
; Give the screen some inital defaults
|
||||
mov [winxs], 400
|
||||
mov [winys], 300
|
||||
mov ax, 100
|
||||
mov [winxo], ax
|
||||
mov [winyo], ax
|
||||
jmp dw_002
|
||||
|
||||
dw_001:
|
||||
mov eax, 9
|
||||
mov ebx, memsize - 1024
|
||||
mov ecx, -1
|
||||
int 0x40
|
||||
mov eax, [ebx + 34]
|
||||
mov [winxo], ax
|
||||
mov eax, [ebx + 38]
|
||||
mov [winyo], ax
|
||||
mov eax, [ebx + 42]
|
||||
mov [winxs], ax
|
||||
mov eax, [ebx + 46]
|
||||
mov [winys], ax
|
||||
|
||||
dw_002:
|
||||
mov ebx, dword [winxo-2]
|
||||
mov bx, [winxs]
|
||||
mov ecx, dword [winyo-2]
|
||||
mov cx, [winys]
|
||||
|
||||
xor eax,eax ; DRAW WINDOW
|
||||
mov edx,[sc.work]
|
||||
or edx,0x33000000
|
||||
mov edi,header ; WINDOW LABEL
|
||||
int 0x40
|
||||
|
||||
|
||||
mov eax,8 ; BUTTON 2: slideshow
|
||||
mov ebx,57
|
||||
mov cx, [winys]
|
||||
sub cx, 39
|
||||
shl ecx, 16
|
||||
add ecx, 12
|
||||
mov esi, [sc.work_button]
|
||||
mov edx,2
|
||||
int 0x40
|
||||
|
||||
mov eax,4 ; Button text
|
||||
movzx ebx, word [winys]
|
||||
add ebx, 3 shl 16 - 36
|
||||
mov ecx,[sc.work_button_text]
|
||||
mov edx,setname
|
||||
mov esi,setnamelen-setname
|
||||
int 0x40
|
||||
|
||||
|
||||
mov eax,8 ; BUTTON 3: set as background
|
||||
mov bx, [winxs]
|
||||
sub bx, 65
|
||||
shl ebx, 16
|
||||
mov bx,55
|
||||
mov cx, [winys]
|
||||
sub cx, 39
|
||||
shl ecx, 16
|
||||
add ecx, 12
|
||||
mov esi, [sc.work_button]
|
||||
mov edx,3
|
||||
int 0x40
|
||||
|
||||
mov eax,4 ; Button text
|
||||
movzx ebx, word [winxs]
|
||||
sub ebx, 63
|
||||
shl ebx,16
|
||||
mov bx, word [winys]
|
||||
sub bx,36
|
||||
mov ecx,[sc.work_button_text]
|
||||
mov edx,setbgr
|
||||
mov esi,setbgrlen-setbgr
|
||||
int 0x40
|
||||
call print_strings
|
||||
call load_image
|
||||
mov eax,12 ; function 12:tell os about windowdraw
|
||||
mov ebx,2 ; 2, end of draw
|
||||
int 0x40
|
||||
|
||||
ret
|
||||
|
||||
|
||||
|
||||
; Read in the image file name.
|
||||
read_string:
|
||||
movzx edi,byte[name_string.cursor]
|
||||
add edi,name_string
|
||||
mov eax,2
|
||||
int 0x40 ; Get the key value
|
||||
shr eax,8
|
||||
cmp eax,13 ; Return key ends input
|
||||
je .rs_done
|
||||
cmp eax,8
|
||||
jnz .nobsl
|
||||
cmp edi,name_string
|
||||
je .exit
|
||||
dec edi
|
||||
mov [edi],byte 0;'_'
|
||||
dec byte[name_string.cursor]
|
||||
jmp print_strings
|
||||
.exit: ret
|
||||
.nobsl:
|
||||
cmp eax,31
|
||||
jbe .exit
|
||||
cmp eax,97
|
||||
jb .keyok
|
||||
sub eax,32
|
||||
.keyok:
|
||||
mov ah,0
|
||||
stosw
|
||||
cmp edi,name_string.end
|
||||
jnc print_strings
|
||||
inc byte[name_string.cursor]
|
||||
jmp print_strings
|
||||
.rs_done:
|
||||
call print_strings
|
||||
mov esi,name_string
|
||||
call open
|
||||
test eax,eax
|
||||
jz .exit
|
||||
call jpeg_info
|
||||
test ebp,ebp
|
||||
jz close
|
||||
xchg [jpeg_st],ebp
|
||||
call jpeg_close
|
||||
|
||||
load_image:
|
||||
|
||||
mov eax,13 ; clear picture area
|
||||
movzx ebx, word [winxs]
|
||||
add ebx, 1 shl 16 -10
|
||||
movzx ecx, word [winys]
|
||||
sub ecx, 40
|
||||
add ecx, 1 shl 16
|
||||
|
||||
mov edx,[sc.work]
|
||||
int 0x40
|
||||
mov ebp,[jpeg_st]
|
||||
test ebp,ebp
|
||||
jz .exit
|
||||
mov dword [ebp+draw_ptr],put_image
|
||||
jmp jpeg_display
|
||||
.exit: ret
|
||||
|
||||
print_strings:
|
||||
pusha
|
||||
mov eax,13 ; clear text area
|
||||
movzx ebx, word [winxs]
|
||||
add ebx, 59 shl 16 -125
|
||||
mov cx, [winys]
|
||||
sub cx, 39
|
||||
shl ecx, 16
|
||||
add ecx, 12
|
||||
mov edx,0xffffff
|
||||
int 0x40
|
||||
|
||||
mov eax,4 ;
|
||||
movzx ebx, word [winys]
|
||||
add ebx, 61 shl 16 - 37
|
||||
mov ecx,0x000000
|
||||
mov edx,name_string
|
||||
mov esi,60
|
||||
int 0x40
|
||||
popa
|
||||
ret
|
||||
|
||||
slideshow:
|
||||
cmp [file_dir], 0
|
||||
jnz .exit
|
||||
cmp [jpeg_st], 0
|
||||
jz .exit
|
||||
mov esi, name_string
|
||||
movzx ecx, byte [name_string.cursor]
|
||||
.l1:
|
||||
cmp byte [esi+ecx], '/'
|
||||
jz .l2
|
||||
loop .l1
|
||||
.exit:
|
||||
ret
|
||||
.l2:
|
||||
mov byte [esi+ecx], 0
|
||||
call open
|
||||
mov byte [esi+ecx], '/'
|
||||
test eax, eax
|
||||
jz .exit
|
||||
test byte [fileattr], 0x10
|
||||
jz .exit
|
||||
mov [file_dir], eax
|
||||
inc ecx
|
||||
mov [name_string.cursor], cl
|
||||
display_next:
|
||||
mov ebx, [file_dir]
|
||||
test ebx, ebx
|
||||
jnz @f
|
||||
ret
|
||||
@@:
|
||||
mov byte [ebx], 1
|
||||
mov byte [ebx+12], 1
|
||||
mov dword [ebx+16], dirinfo
|
||||
mov eax, 70
|
||||
int 0x40
|
||||
mov eax, [file_dir]
|
||||
inc dword [eax+4]
|
||||
cmp ebx, 1
|
||||
jz @f
|
||||
mov eax, [file_dir]
|
||||
and [file_dir], 0
|
||||
jmp close
|
||||
@@:
|
||||
movzx edi, byte [name_string.cursor]
|
||||
add edi, name_string
|
||||
lea esi, [dirinfo+32+40]
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
test al, al
|
||||
jnz @b
|
||||
mov ecx, name_string.end
|
||||
sub ecx, edi
|
||||
rep stosb
|
||||
call print_strings
|
||||
mov esi,name_string
|
||||
call open
|
||||
test eax,eax
|
||||
jz display_next
|
||||
call jpeg_info
|
||||
test ebp,ebp
|
||||
jnz .l6
|
||||
call close
|
||||
jmp display_next
|
||||
.l6:
|
||||
mov dword[ebp+draw_ptr],put_image
|
||||
push ebp
|
||||
xchg [jpeg_st],ebp
|
||||
call jpeg_close
|
||||
pop ebp
|
||||
jmp jpeg_display
|
||||
|
||||
|
||||
include 'filelib.asm'
|
||||
include 'memlib.asm'
|
||||
include 'jpeglib.asm'
|
||||
|
||||
|
||||
; DATA AREA
|
||||
|
||||
wcolor dd 0x000000
|
||||
header db appname,version,0
|
||||
setname db 'SLIDESHOW'
|
||||
setnamelen:
|
||||
|
||||
setbgr db ' BGR '
|
||||
setbgrlen:
|
||||
|
||||
x_pointer dd 0
|
||||
x_offset dd 0
|
||||
x_numofbytes dd 0
|
||||
x_numofb2 dd 0
|
||||
x_counter dd 0
|
||||
winxo dw 0
|
||||
winyo dw 0
|
||||
winxs dw 0
|
||||
winys dw 0
|
||||
jpeg_st dd 0
|
||||
file_dir dd 0
|
||||
name_string: db '/HD0/1/KOLIBRI/ETC/jpegview.jpg',0
|
||||
rb 256
|
||||
.end:
|
||||
.cursor: db 19
|
||||
.cursor2: db 0
|
||||
|
||||
align 4
|
||||
|
||||
rgb16: db 0,4,8,13,17,21,25,29,34,38,42,46,50,55,59,63
|
||||
rgb4: db 0,21,42,63
|
||||
|
||||
include 'jpegdat.asm'
|
||||
|
||||
align 4
|
||||
|
||||
iniciomemoria:
|
||||
dd -(iniciomemoria+4),-(iniciomemoria+4),(iniciomemoria+4),.l1,0
|
||||
.l1 dd 0
|
||||
|
||||
fin:
|
||||
I_END:
|
||||
sc system_colors
|
||||
fileattr: rb 40
|
||||
dirinfo: rb 32+304
|
Binary file not shown.
Before Width: | Height: | Size: 19 KiB |
@ -1,268 +0,0 @@
|
||||
; new application structure
|
||||
macro meos_app_start
|
||||
{
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
db 'MENUET01'
|
||||
dd 0x01
|
||||
dd __start
|
||||
dd __end
|
||||
dd __memory
|
||||
dd __stack
|
||||
|
||||
if used __params & ~defined __params
|
||||
dd __params
|
||||
else
|
||||
dd 0x0
|
||||
end if
|
||||
|
||||
dd 0x0
|
||||
}
|
||||
MEOS_APP_START fix meos_app_start
|
||||
|
||||
macro code
|
||||
{
|
||||
__start:
|
||||
}
|
||||
CODE fix code
|
||||
|
||||
macro data
|
||||
{
|
||||
__data:
|
||||
}
|
||||
DATA fix data
|
||||
|
||||
macro udata
|
||||
{
|
||||
if used __params & ~defined __params
|
||||
__params:
|
||||
db 0
|
||||
__end:
|
||||
rb 255
|
||||
else
|
||||
__end:
|
||||
end if
|
||||
__udata:
|
||||
}
|
||||
UDATA fix udata
|
||||
|
||||
macro meos_app_end
|
||||
{
|
||||
align 32
|
||||
rb 2048
|
||||
__stack:
|
||||
__memory:
|
||||
}
|
||||
MEOS_APP_END fix meos_app_end
|
||||
|
||||
|
||||
; macro for defining multiline text data
|
||||
struc mstr [sstring]
|
||||
{
|
||||
forward
|
||||
local ssize
|
||||
virtual at 0
|
||||
db sstring
|
||||
ssize = $
|
||||
end virtual
|
||||
dd ssize
|
||||
db sstring
|
||||
common
|
||||
dd -1
|
||||
}
|
||||
|
||||
|
||||
; strings
|
||||
macro sz name,[data] { ; from MFAR [mike.dld]
|
||||
common
|
||||
if used name
|
||||
label name
|
||||
end if
|
||||
forward
|
||||
if used name
|
||||
db data
|
||||
end if
|
||||
common
|
||||
if used name
|
||||
.size = $-name
|
||||
end if
|
||||
}
|
||||
|
||||
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
|
||||
common
|
||||
if used name
|
||||
label name
|
||||
end if
|
||||
forward
|
||||
if (used name)&(lang eq lng)
|
||||
db data
|
||||
end if
|
||||
common
|
||||
if used name
|
||||
.size = $-name
|
||||
end if
|
||||
}
|
||||
|
||||
|
||||
|
||||
; easy system call macro
|
||||
macro mpack dest, hsrc, lsrc
|
||||
{
|
||||
if (hsrc eqtype 0) & (lsrc eqtype 0)
|
||||
mov dest, (hsrc) shl 16 + lsrc
|
||||
else
|
||||
if (hsrc eqtype 0) & (~lsrc eqtype 0)
|
||||
mov dest, (hsrc) shl 16
|
||||
add dest, lsrc
|
||||
else
|
||||
mov dest, hsrc
|
||||
shl dest, 16
|
||||
add dest, lsrc
|
||||
end if
|
||||
end if
|
||||
}
|
||||
|
||||
macro __mov reg,a,b { ; mike.dld
|
||||
if (~a eq)&(~b eq)
|
||||
mpack reg,a,b
|
||||
else if (~a eq)&(b eq)
|
||||
mov reg,a
|
||||
end if
|
||||
}
|
||||
|
||||
macro mcall a,b,c,d,e,f { ; mike.dld
|
||||
__mov eax,a
|
||||
__mov ebx,b
|
||||
__mov ecx,c
|
||||
__mov edx,d
|
||||
__mov esi,e
|
||||
__mov edi,f
|
||||
int 0x40
|
||||
}
|
||||
|
||||
|
||||
|
||||
; language for programs
|
||||
lang fix ru ; ru en fr ge fi
|
||||
|
||||
|
||||
|
||||
; optimize the code for size
|
||||
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
|
||||
|
||||
macro add arg1,arg2
|
||||
{
|
||||
if (arg2 eqtype 0)
|
||||
if (arg2) = 1
|
||||
inc arg1
|
||||
else
|
||||
add arg1,arg2
|
||||
end if
|
||||
else
|
||||
add arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
macro sub arg1,arg2
|
||||
{
|
||||
if (arg2 eqtype 0)
|
||||
if (arg2) = 1
|
||||
dec arg1
|
||||
else
|
||||
sub arg1,arg2
|
||||
end if
|
||||
else
|
||||
sub arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
macro mov arg1,arg2
|
||||
{
|
||||
if (arg1 in __regs) & (arg2 eqtype 0)
|
||||
if (arg2) = 0
|
||||
xor arg1,arg1
|
||||
else if (arg2) = 1
|
||||
xor arg1,arg1
|
||||
inc arg1
|
||||
else if (arg2) = -1
|
||||
or arg1,-1
|
||||
else if (arg2) > -128 & (arg2) < 128
|
||||
push arg2
|
||||
pop arg1
|
||||
else
|
||||
mov arg1,arg2
|
||||
end if
|
||||
else
|
||||
mov arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
|
||||
macro struct name
|
||||
{
|
||||
virtual at 0
|
||||
name name
|
||||
sizeof.#name = $ - name
|
||||
end virtual
|
||||
}
|
||||
|
||||
; structures used in MeOS
|
||||
struc process_information
|
||||
{
|
||||
.cpu_usage dd ? ; +0
|
||||
.window_stack_position dw ? ; +4
|
||||
.window_stack_value dw ? ; +6
|
||||
.not_used1 dw ? ; +8
|
||||
.process_name rb 12 ; +10
|
||||
.memory_start dd ? ; +22
|
||||
.used_memory dd ? ; +26
|
||||
.PID dd ? ; +30
|
||||
.x_start dd ? ; +34
|
||||
.y_start dd ? ; +38
|
||||
.x_size dd ? ; +42
|
||||
.y_size dd ? ; +46
|
||||
.slot_state dw ? ; +50
|
||||
rb (1024-52)
|
||||
}
|
||||
struct process_information
|
||||
|
||||
struc system_colors
|
||||
{
|
||||
.frame dd ?
|
||||
.grab dd ?
|
||||
.grab_button dd ?
|
||||
.grab_button_text dd ?
|
||||
.grab_text dd ?
|
||||
.work dd ?
|
||||
.work_button dd ?
|
||||
.work_button_text dd ?
|
||||
.work_text dd ?
|
||||
.work_graph dd ?
|
||||
}
|
||||
struct system_colors
|
||||
|
||||
|
||||
; constants
|
||||
|
||||
; events
|
||||
EV_IDLE = 0
|
||||
EV_TIMER = 0
|
||||
EV_REDRAW = 1
|
||||
EV_KEY = 2
|
||||
EV_BUTTON = 3
|
||||
EV_EXIT = 4
|
||||
EV_BACKGROUND = 5
|
||||
EV_MOUSE = 6
|
||||
EV_IPC = 7
|
||||
EV_STACK = 8
|
||||
|
||||
; event mask bits for function 40
|
||||
EVM_REDRAW = 1b
|
||||
EVM_KEY = 10b
|
||||
EVM_BUTTON = 100b
|
||||
EVM_EXIT = 1000b
|
||||
EVM_BACKGROUND = 10000b
|
||||
EVM_MOUSE = 100000b
|
||||
EVM_IPC = 1000000b
|
||||
EVM_STACK = 10000000b
|
@ -1,210 +0,0 @@
|
||||
|
||||
movedata:
|
||||
push eax
|
||||
xor eax,eax
|
||||
sub eax,edi
|
||||
and eax,3
|
||||
xchg ecx,eax
|
||||
sub eax,ecx
|
||||
jle .l1
|
||||
rep movsb
|
||||
mov ecx,eax
|
||||
shr ecx,2
|
||||
rep movsd
|
||||
and eax,3
|
||||
.l1: add ecx,eax
|
||||
rep movsb
|
||||
pop eax
|
||||
ret
|
||||
|
||||
mallocz:
|
||||
call malloc
|
||||
pushad
|
||||
add ecx,3
|
||||
xor eax,eax
|
||||
shr ecx,2
|
||||
rep stosd
|
||||
popad
|
||||
ret
|
||||
|
||||
mresize1: popad
|
||||
xor edi,edi
|
||||
stc
|
||||
mresize2: ret
|
||||
mresize: ; puntero en di ncr retorna nuevo puntero en di
|
||||
test edi,edi
|
||||
jz malloc
|
||||
cmp ecx,[edi-4]
|
||||
je mresize2
|
||||
call free
|
||||
malloc:
|
||||
mov edi,ecx
|
||||
jecxz mresize2
|
||||
pushad
|
||||
mov esi,iniciomemoria+4
|
||||
lea ebx,[ecx+3]
|
||||
and ebx,-4 ;redondeo a 4
|
||||
.l1: mov edi,esi
|
||||
add esi,[esi]
|
||||
jc mresize1
|
||||
lodsd
|
||||
cmp eax,ebx
|
||||
jc .l1
|
||||
cmp esi,[iniciomemoria+8]
|
||||
jc .l2
|
||||
jne mresize1
|
||||
lea edx,[ebx+esi+4]
|
||||
cmp edx,[iniciomemoria+12]
|
||||
jnc mresize1
|
||||
mov [iniciomemoria+8],edx
|
||||
.l2: pop dword [esi-4]
|
||||
push esi
|
||||
sub eax,ebx
|
||||
je .l3
|
||||
sub eax,4
|
||||
mov [esi+ebx],eax
|
||||
jz .l3
|
||||
;fragmentar
|
||||
add ebx,4
|
||||
add [edi],ebx
|
||||
mov eax,[esi]
|
||||
sub eax,ebx
|
||||
mov [esi+ebx],eax
|
||||
popad
|
||||
ret
|
||||
.l3: lodsd
|
||||
add eax,4
|
||||
add [edi],eax
|
||||
popad
|
||||
ret
|
||||
|
||||
realloc: test edi,edi
|
||||
jz malloc
|
||||
jecxz free
|
||||
pushad
|
||||
pop esi
|
||||
mov eax,[edi-4]
|
||||
call malloc
|
||||
push edi
|
||||
cmp ecx,eax
|
||||
jc .l1
|
||||
mov ecx,eax
|
||||
.l1: push esi
|
||||
call movedata
|
||||
pop edi
|
||||
call free
|
||||
popad
|
||||
.l2: ret
|
||||
free: ;puntero en di
|
||||
;no se comprueban los punteros
|
||||
;retorna di=0 , ncr
|
||||
test edi,edi
|
||||
jz realloc.l2
|
||||
pushad
|
||||
pop edi
|
||||
mov ebp,[edi-4]
|
||||
dec ebp
|
||||
and ebp,-4 ;redondeo a 4,dx=dx-4
|
||||
xor edx,edx
|
||||
push edx
|
||||
mov edx,iniciomemoria+4
|
||||
mov esi,edx
|
||||
;buscar puntero libre anterior
|
||||
.l1: mov ebx,esi
|
||||
lodsd
|
||||
add esi,eax
|
||||
cmp esi,edi
|
||||
jc .l1
|
||||
;enlazar
|
||||
mov ecx,esi
|
||||
sub ecx,edi
|
||||
sub eax,ecx
|
||||
sub ecx,4
|
||||
mov [ebx],eax
|
||||
;fusionar con el anterior
|
||||
cmp eax,[ebx-4]
|
||||
jne .l2
|
||||
cmp ebx,edx
|
||||
je .l2 ;no fusionar con el primero
|
||||
mov edi,ebx
|
||||
add eax,4
|
||||
add ecx,eax
|
||||
add ebp,eax
|
||||
.l2: mov ebx,ebp ;fusionar con bloques de tama¤o 0
|
||||
.l3: add ebx,4
|
||||
test dword [edi+ebx],-1
|
||||
jz .l3
|
||||
cmp ebx,ecx
|
||||
jne .l4
|
||||
;fusionar con el siguiente
|
||||
add ebx,[esi-4]
|
||||
add ecx,[esi]
|
||||
add ebx,4
|
||||
add ecx,4
|
||||
cmp esi,[edx+4]
|
||||
jne .l4
|
||||
mov [edx+4],edi
|
||||
.l4: mov [edi-4],ebx
|
||||
mov [edi],ecx
|
||||
popad
|
||||
ret
|
||||
|
||||
add_mem: ;edi,ecx ;el ultimo bloque libre debe ser >8 bytes para poder fragmentarlo
|
||||
cmp ecx,64
|
||||
jc .l1
|
||||
add ecx,edi
|
||||
add edi,3
|
||||
and edi,-4
|
||||
and ecx,-4
|
||||
mov eax,ecx
|
||||
sub ecx,edi ;redondeo
|
||||
xchg eax,[iniciomemoria+12]
|
||||
cmp edi,eax
|
||||
jna .l1
|
||||
lea esi,[edi+4]
|
||||
mov edx,esi
|
||||
xchg esi,[iniciomemoria+8]
|
||||
neg edx
|
||||
mov [edi],edx
|
||||
mov [edi+4],edx
|
||||
lea edx,[edi-4]
|
||||
sub edi,esi
|
||||
mov [esi],edi
|
||||
sub eax,4
|
||||
sub eax,esi
|
||||
mov [esi-4],eax
|
||||
add esi,eax
|
||||
sub edx,esi
|
||||
mov [esi],edx
|
||||
.l1: ret
|
||||
|
||||
check_mem: ;busqueda de errores en la memoria
|
||||
;retorna edx nbloques o 0 si error,ecx memoria libre
|
||||
;ncr: ebp,ebx,eax
|
||||
mov edi,iniciomemoria
|
||||
mov esi,edi
|
||||
xor edx,edx
|
||||
mov ecx,[edi]
|
||||
neg ecx ;el primer bloque no cuenta
|
||||
.l1: add ecx,[edi]
|
||||
add edi,4
|
||||
add edi,[edi]
|
||||
.l2: inc edx
|
||||
add esi,[esi]
|
||||
jc .l4
|
||||
add esi,7
|
||||
jc .l3
|
||||
and esi,-4
|
||||
cmp esi,edi
|
||||
jc .l2
|
||||
je .l1
|
||||
jmp .l4
|
||||
.l3: test edi,edi
|
||||
jnz .l4
|
||||
add ecx,[iniciomemoria+12]
|
||||
ret
|
||||
.l4: xor edx,edx
|
||||
stc
|
||||
ret
|
||||
|
||||
|
@ -1,11 +0,0 @@
|
||||
7 # <- Number of programs in the list
|
||||
|
||||
# Program Parameters Delay
|
||||
/HD0/1/KOLIBRI/BIN/SETUP BOOT 99 # System setup
|
||||
/HD0/1/KOLIBRI/BIN/JPEGVIEW BOOT 99 # Background image
|
||||
/HD0/1/KOLIBRI/BIN/@RB <NO> 30 # Desktop right-click menu
|
||||
/HD0/1/KOLIBRI/BIN/@SS <NO> 30 # Screensaver
|
||||
/HD0/1/KOLIBRI/BIN/@TRACKER <NO> 30 # tracker
|
||||
/HD0/1/KOLIBRI/BIN/@TASKBAR <NO> 30 # taskbar
|
||||
/HD0/1/KOLIBRI/BIN/@DOCK <NO> 30 # dock
|
||||
### Total: 2.6 seconds ###
|
@ -1,2 +0,0 @@
|
||||
echo lang fix en >lang.inc
|
||||
fasm launcher.asm launcher
|
@ -1,200 +0,0 @@
|
||||
;
|
||||
; LAUNCHER - €‚’Ž‡€<E280A1>“‘Š <20><>Žƒ<C5BD>€ŒŒ
|
||||
; Š®¤ ¯à®£à ¬¬ë ᮢᥬ ¥ ®¯â¨¬¨§¨à®¢ , ® ®ç¥ì ¯à®áâ ¤«ï ¯®¨¬ ¨ï.
|
||||
; <20>â®â « ãç¥à £à㧨⠨ä®à¬ æ¨î ® ¯à®£à ¬¬ å ¤«ï § ¯ã᪠¨§ ä ©«
|
||||
; AUTORUN.DAT. ”®à¬ â ®ç¥ì ¯à®áâ ¨ ¢ ª®¬¬¥â à¨ïå ¥ 㦤 ¥âáï.
|
||||
;
|
||||
; Š®¬¯¨«¨àã©â¥ á ¯®¬®éìî FASM 1.52 ¨ ¢ëè¥
|
||||
;
|
||||
include "MACROS.INC"
|
||||
|
||||
use32
|
||||
org 0x0
|
||||
db 'MENUET01' ; 8 byte id
|
||||
dd 0x01 ; header version
|
||||
dd START ; start of code
|
||||
dd I_END ; size of image
|
||||
dd 0x8000 ; memory for app
|
||||
dd 0x8000 ; esp
|
||||
dd 0x0 , 0x0 ; I_Param , I_Icon
|
||||
|
||||
;include "DEBUG.INC"
|
||||
|
||||
START: ; start of execution
|
||||
|
||||
; mov eax, 5
|
||||
; mov ebx, 10
|
||||
; int 0x40
|
||||
|
||||
mcall 18,15
|
||||
|
||||
mov eax, 70 ; load AUTORUN.DAT
|
||||
mov ebx, autorun_dat_info
|
||||
int 0x40
|
||||
|
||||
call get_number
|
||||
mov [number_of_files], eax
|
||||
;dps "NUMBER OF FILES: "
|
||||
;dpd eax
|
||||
;dps <13,10>
|
||||
call next_line
|
||||
|
||||
start_program:
|
||||
;dps <"STARTING A PROGRAM",13,10>
|
||||
call clear_strings
|
||||
mov edi, program
|
||||
call get_string
|
||||
mov edi, parameters
|
||||
call get_string
|
||||
call get_number
|
||||
call run_program
|
||||
call next_line
|
||||
dec [number_of_files]
|
||||
jnz start_program
|
||||
|
||||
exit:
|
||||
or eax, -1
|
||||
int 0x40
|
||||
|
||||
|
||||
run_program: ; time to delay in eax
|
||||
push eax
|
||||
mcall 70, start_info
|
||||
pop ebx
|
||||
|
||||
mov eax, 5
|
||||
int 0x40
|
||||
ret
|
||||
|
||||
|
||||
clear_strings: ; clears buffers
|
||||
pushad
|
||||
|
||||
mov ecx, 60
|
||||
mov edi, program
|
||||
xor al, al ;mov al, ' '
|
||||
rep stosb
|
||||
|
||||
mov ecx, 60
|
||||
mov edi, parameters
|
||||
rep stosb
|
||||
|
||||
popad
|
||||
ret
|
||||
|
||||
|
||||
get_string: ; pointer to destination buffer in edi
|
||||
pushad
|
||||
call skip_spaces
|
||||
mov esi, [position]
|
||||
;dpd esi
|
||||
;dps <13,10>
|
||||
add esi, file_data
|
||||
.start:
|
||||
lodsb
|
||||
cmp al, ' '
|
||||
je .finish
|
||||
stosb
|
||||
inc [position]
|
||||
jmp .start
|
||||
.finish:
|
||||
popad
|
||||
ret
|
||||
|
||||
|
||||
get_number:
|
||||
push ebx esi
|
||||
call skip_spaces
|
||||
mov esi, [position]
|
||||
add esi, file_data
|
||||
xor eax, eax
|
||||
xor ebx, ebx
|
||||
.start:
|
||||
lodsb
|
||||
sub al, '0'
|
||||
cmp al, 9
|
||||
ja .finish
|
||||
lea ebx,[ebx*4+ebx]
|
||||
lea ebx,[ebx*2+eax]
|
||||
inc [position]
|
||||
jmp .start
|
||||
.finish:
|
||||
mov eax, ebx
|
||||
pop esi ebx
|
||||
ret
|
||||
|
||||
|
||||
skip_spaces:
|
||||
pushad
|
||||
xor eax, eax
|
||||
mov esi, [position]
|
||||
add esi, file_data
|
||||
.start:
|
||||
lodsb
|
||||
cmp al, ' '
|
||||
jne .finish
|
||||
inc [position]
|
||||
jmp .start
|
||||
.finish:
|
||||
;dps "NOW AL = "
|
||||
;mov [tmp],al
|
||||
;mov edx, tmp
|
||||
;call debug_outstr
|
||||
;dps <13,10>
|
||||
popad
|
||||
ret
|
||||
|
||||
|
||||
next_line:
|
||||
pushad
|
||||
mov esi, [position]
|
||||
add esi, file_data
|
||||
.start:
|
||||
lodsb
|
||||
cmp al, 13
|
||||
je .finish
|
||||
inc [position]
|
||||
jmp .start
|
||||
.finish:
|
||||
add [position], 2
|
||||
inc esi
|
||||
lodsb
|
||||
cmp al, '#'
|
||||
je .skipline
|
||||
cmp al, 13
|
||||
jne .donotskip
|
||||
.skipline:
|
||||
call next_line
|
||||
.donotskip:
|
||||
popad
|
||||
ret
|
||||
|
||||
|
||||
|
||||
; DATA:
|
||||
position dd 0 ; position in file
|
||||
|
||||
autorun_dat_info: ; AUTORUN.DAT
|
||||
.mode dd 0 ; read file
|
||||
.start_block dd 0 ; block to read
|
||||
dd 0
|
||||
.blocks dd 16*512 ; 16*512 bytes max
|
||||
.address dd file_data
|
||||
db "/HD0/1/KOLIBRI/ETC/AUTORUN.DAT",0
|
||||
|
||||
start_info:
|
||||
.mode dd 7
|
||||
dd 0
|
||||
.params dd parameters
|
||||
dd 0
|
||||
dd 0
|
||||
.path: ;
|
||||
|
||||
I_END:
|
||||
|
||||
program rb 61 ; 60 + [0] char
|
||||
parameters rb 61
|
||||
|
||||
number_of_files dd ?
|
||||
|
||||
file_data rb 16*512
|
@ -1,269 +0,0 @@
|
||||
; new application structure
|
||||
macro meos_app_start
|
||||
{
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
db 'MENUET01'
|
||||
dd 0x01
|
||||
dd __start
|
||||
dd __end
|
||||
dd __memory
|
||||
dd __stack
|
||||
|
||||
if used __params & ~defined __params
|
||||
dd __params
|
||||
else
|
||||
dd 0x0
|
||||
end if
|
||||
|
||||
dd 0x0
|
||||
}
|
||||
MEOS_APP_START fix meos_app_start
|
||||
|
||||
macro code
|
||||
{
|
||||
__start:
|
||||
}
|
||||
CODE fix code
|
||||
|
||||
macro data
|
||||
{
|
||||
__data:
|
||||
}
|
||||
DATA fix data
|
||||
|
||||
macro udata
|
||||
{
|
||||
if used __params & ~defined __params
|
||||
__params:
|
||||
db 0
|
||||
__end:
|
||||
rb 255
|
||||
else
|
||||
__end:
|
||||
end if
|
||||
__udata:
|
||||
}
|
||||
UDATA fix udata
|
||||
|
||||
macro meos_app_end
|
||||
{
|
||||
align 32
|
||||
rb 2048
|
||||
__stack:
|
||||
__memory:
|
||||
}
|
||||
MEOS_APP_END fix meos_app_end
|
||||
|
||||
|
||||
; macro for defining multiline text data
|
||||
struc mstr [sstring]
|
||||
{
|
||||
forward
|
||||
local ssize
|
||||
virtual at 0
|
||||
db sstring
|
||||
ssize = $
|
||||
end virtual
|
||||
dd ssize
|
||||
db sstring
|
||||
common
|
||||
dd -1
|
||||
}
|
||||
|
||||
|
||||
; strings
|
||||
macro sz name,[data] { ; from MFAR [mike.dld]
|
||||
common
|
||||
if used name
|
||||
label name
|
||||
end if
|
||||
forward
|
||||
if used name
|
||||
db data
|
||||
end if
|
||||
common
|
||||
if used name
|
||||
.size = $-name
|
||||
end if
|
||||
}
|
||||
|
||||
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
|
||||
common
|
||||
if used name
|
||||
label name
|
||||
end if
|
||||
forward
|
||||
if (used name)&(lang eq lng)
|
||||
db data
|
||||
end if
|
||||
common
|
||||
if used name
|
||||
.size = $-name
|
||||
end if
|
||||
}
|
||||
|
||||
|
||||
|
||||
; easy system call macro
|
||||
macro mpack dest, hsrc, lsrc
|
||||
{
|
||||
if (hsrc eqtype 0) & (lsrc eqtype 0)
|
||||
mov dest, (hsrc) shl 16 + lsrc
|
||||
else
|
||||
if (hsrc eqtype 0) & (~lsrc eqtype 0)
|
||||
mov dest, (hsrc) shl 16
|
||||
add dest, lsrc
|
||||
else
|
||||
mov dest, hsrc
|
||||
shl dest, 16
|
||||
add dest, lsrc
|
||||
end if
|
||||
end if
|
||||
}
|
||||
|
||||
macro __mov reg,a,b { ; mike.dld
|
||||
if (~a eq)&(~b eq)
|
||||
mpack reg,a,b
|
||||
else if (~a eq)&(b eq)
|
||||
mov reg,a
|
||||
end if
|
||||
}
|
||||
|
||||
macro mcall a,b,c,d,e,f { ; mike.dld
|
||||
__mov eax,a
|
||||
__mov ebx,b
|
||||
__mov ecx,c
|
||||
__mov edx,d
|
||||
__mov esi,e
|
||||
__mov edi,f
|
||||
int 0x40
|
||||
}
|
||||
|
||||
|
||||
|
||||
; optimize the code for size
|
||||
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
|
||||
|
||||
macro add arg1,arg2
|
||||
{
|
||||
if (arg2 eqtype 0)
|
||||
if (arg2) = 1
|
||||
inc arg1
|
||||
else
|
||||
add arg1,arg2
|
||||
end if
|
||||
else
|
||||
add arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
macro sub arg1,arg2
|
||||
{
|
||||
if (arg2 eqtype 0)
|
||||
if (arg2) = 1
|
||||
dec arg1
|
||||
else
|
||||
sub arg1,arg2
|
||||
end if
|
||||
else
|
||||
sub arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
macro mov arg1,arg2
|
||||
{
|
||||
if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
|
||||
if (arg2) = 0
|
||||
xor arg1,arg1
|
||||
else if (arg2) = 1
|
||||
xor arg1,arg1
|
||||
inc arg1
|
||||
else if (arg2) = -1
|
||||
or arg1,-1
|
||||
else if (arg2) > -128 & (arg2) < 128
|
||||
push arg2
|
||||
pop arg1
|
||||
else
|
||||
mov arg1,arg2
|
||||
end if
|
||||
else
|
||||
mov arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
|
||||
macro struct name
|
||||
{
|
||||
virtual at 0
|
||||
name name
|
||||
sizeof.#name = $ - name
|
||||
end virtual
|
||||
}
|
||||
|
||||
; structures used in MeOS
|
||||
struc process_information
|
||||
{
|
||||
.cpu_usage dd ? ; +0
|
||||
.window_stack_position dw ? ; +4
|
||||
.window_stack_value dw ? ; +6
|
||||
.not_used1 dw ? ; +8
|
||||
.process_name rb 12 ; +10
|
||||
.memory_start dd ? ; +22
|
||||
.used_memory dd ? ; +26
|
||||
.PID dd ? ; +30
|
||||
.x_start dd ? ; +34
|
||||
.y_start dd ? ; +38
|
||||
.x_size dd ? ; +42
|
||||
.y_size dd ? ; +46
|
||||
.slot_state dw ? ; +50
|
||||
dw ? ; +52 - reserved
|
||||
.client_left dd ? ; +54
|
||||
.client_top dd ? ; +58
|
||||
.client_width dd ? ; +62
|
||||
.client_height dd ? ; +66
|
||||
.wnd_state db ? ; +70
|
||||
rb (1024-71)
|
||||
}
|
||||
struct process_information
|
||||
|
||||
struc system_colors
|
||||
{
|
||||
.frame dd ?
|
||||
.grab dd ?
|
||||
.grab_button dd ?
|
||||
.grab_button_text dd ?
|
||||
.grab_text dd ?
|
||||
.work dd ?
|
||||
.work_button dd ?
|
||||
.work_button_text dd ?
|
||||
.work_text dd ?
|
||||
.work_graph dd ?
|
||||
}
|
||||
struct system_colors
|
||||
|
||||
|
||||
; constants
|
||||
|
||||
; events
|
||||
EV_IDLE = 0
|
||||
EV_TIMER = 0
|
||||
EV_REDRAW = 1
|
||||
EV_KEY = 2
|
||||
EV_BUTTON = 3
|
||||
EV_EXIT = 4
|
||||
EV_BACKGROUND = 5
|
||||
EV_MOUSE = 6
|
||||
EV_IPC = 7
|
||||
EV_STACK = 8
|
||||
|
||||
; event mask bits for function 40
|
||||
EVM_REDRAW = 1b
|
||||
EVM_KEY = 10b
|
||||
EVM_BUTTON = 100b
|
||||
EVM_EXIT = 1000b
|
||||
EVM_BACKGROUND = 10000b
|
||||
EVM_MOUSE = 100000b
|
||||
EVM_IPC = 1000000b
|
||||
EVM_STACK = 10000000b
|
@ -1,163 +0,0 @@
|
||||
#0 **** MAIN ****
|
||||
GAMES > /@6
|
||||
DEMOS > /@1
|
||||
GRAPHICS > /@12
|
||||
SOUND AND MUSIC > /@11
|
||||
DEVELOPMENT > /@2
|
||||
SYSTEM > /@4
|
||||
NETWORK > /@3
|
||||
OTHER > /@5
|
||||
HELP /HD0/1/KOLIBRI/BIN/docpak
|
||||
RUN APPLICATION /HD0/1/KOLIBRI/BIN/run
|
||||
SHUTDOWN /HD0/1/KOLIBRI/BIN/end
|
||||
#1 **** DEMOS ****
|
||||
FIRE /HD0/1/KOLIBRI/BIN/fire
|
||||
FIRE2 /HD0/1/KOLIBRI/BIN/fire2
|
||||
CIRCLE /HD0/1/KOLIBRI/BIN/circle
|
||||
TRANSPARENCY /HD0/1/KOLIBRI/BIN/transp
|
||||
FRACTAL /HD0/1/KOLIBRI/BIN/tinyfrac
|
||||
COLOR DEMO /HD0/1/KOLIBRI/BIN/colorref
|
||||
EYES /HD0/1/KOLIBRI/BIN/eyes
|
||||
TUBE /HD0/1/KOLIBRI/BIN/tube
|
||||
PLASMA /HD0/1/KOLIBRI/BIN/plasma
|
||||
MOVEBACK /HD0/1/KOLIBRI/BIN/movback
|
||||
LIFE /HD0/1/KOLIBRI/BIN/life2
|
||||
SDLFIRE /HD0/1/KOLIBRI/BIN/sdlfire
|
||||
TRANTEST /HD0/1/KOLIBRI/BIN/trantest
|
||||
3D > /@15
|
||||
#2 **** PROGRAMMING ****
|
||||
ARCHIVER MHC /HD0/1/KOLIBRI/BIN/mhc
|
||||
PACKER MTAPPACK /HD0/1/KOLIBRI/BIN/mtappack
|
||||
TINYPAD /HD0/1/KOLIBRI/BIN/tinypad
|
||||
TINYPAD2 /HD0/1/KOLIBRI/BIN/tinypad2
|
||||
FLAT ASSEMBLER /HD0/1/KOLIBRI/BIN/fasm
|
||||
HEX-EDITOR /HD0/1/KOLIBRI/BIN/heed
|
||||
ASCII-CODES /HD0/1/KOLIBRI/BIN/keyascii
|
||||
SCAN-CODES /HD0/1/KOLIBRI/BIN/scancode
|
||||
HEX2DEC2BIN /HD0/1/KOLIBRI/BIN/h2d2b
|
||||
CALCULATOR /HD0/1/KOLIBRI/BIN/calc
|
||||
DEBUG BOARD /HD0/1/KOLIBRI/BIN/board
|
||||
DEBUGGER /HD0/1/KOLIBRI/BIN/mtdbg
|
||||
EXAMPLES > /@7
|
||||
#3 **** NET ****
|
||||
CONFIGURATION /HD0/1/KOLIBRI/BIN/stackcfg
|
||||
NET STATUS /HD0/1/KOLIBRI/BIN/ethstat
|
||||
ARP STATUS /HD0/1/KOLIBRI/BIN/arpstat
|
||||
DNS RESOLVER /HD0/1/KOLIBRI/BIN/dnsr
|
||||
DHCP (ONLY TEST) /HD0/1/KOLIBRI/BIN/dhcp
|
||||
AUTODHCP /HD0/1/KOLIBRI/BIN/autodhcp
|
||||
TERMINAL /HD0/1/KOLIBRI/BIN/terminal
|
||||
LOCAL CLUSTER /HD0/1/KOLIBRI/BIN/local
|
||||
REMOTE CLUSTER /HD0/1/KOLIBRI/BIN/remote
|
||||
SERVERS > /@9
|
||||
CLIENTS > /@10
|
||||
#4 **** SYSTEM ****
|
||||
PROTECTION TEST /HD0/1/KOLIBRI/BIN/test
|
||||
DEBUG BOARD /HD0/1/KOLIBRI/BIN/board
|
||||
READ HDD /HD0/1/KOLIBRI/BIN/hdread
|
||||
ADJUSTMENT > /@8
|
||||
SYSTEM SENSORS > /@14
|
||||
WORK WITH FILES > /@13
|
||||
#5 **** MISC ****
|
||||
SCREEN MAGNIFIER /HD0/1/KOLIBRI/BIN/magnify
|
||||
ANALOGUE CLOCK /HD0/1/KOLIBRI/BIN/aclock
|
||||
BINARY CLOCK /HD0/1/KOLIBRI/BIN/bcdclk
|
||||
TIMER /HD0/1/KOLIBRI/BIN/timer
|
||||
SCRSHOOT /HD0/1/KOLIBRI/BIN/scrshoot
|
||||
CALENDAR /HD0/1/KOLIBRI/BIN/calendar
|
||||
BGI FONT DEMO /HD0/1/KOLIBRI/BIN/bgitest
|
||||
RTF READER /HD0/1/KOLIBRI/BIN/rtfread
|
||||
@RCHER /HD0/1/KOLIBRI/BIN/@rcher
|
||||
#6 **** GAMES ****
|
||||
TETRIS /HD0/1/KOLIBRI/BIN/tetris
|
||||
C4 /HD0/1/KOLIBRI/BIN/c4
|
||||
15 /HD0/1/KOLIBRI/BIN/15
|
||||
MINE /HD0/1/KOLIBRI/BIN/mine
|
||||
PONG /HD0/1/KOLIBRI/BIN/pong
|
||||
MEMORY BLOCKS /HD0/1/KOLIBRI/BIN/mblocks
|
||||
NEW PONG /HD0/1/KOLIBRI/BIN/pong3
|
||||
PHENIX /HD0/1/KOLIBRI/BIN/phenix
|
||||
FREECELL /HD0/1/KOLIBRI/BIN/freecell
|
||||
ARCANII /HD0/1/KOLIBRI/BIN/arcanii
|
||||
CLICKOMANIA /HD0/1/KOLIBRI/BIN/click
|
||||
RED SQUARE /HD0/1/KOLIBRI/BIN/rsquare
|
||||
PIPES /HD0/1/KOLIBRI/BIN/pipes
|
||||
XONIX /HD0/1/KOLIBRI/BIN/xonix
|
||||
PHARAOH TOMB /HD0/1/KOLIBRI/BIN/fara
|
||||
SQ_GAME /HD0/1/KOLIBRI/BIN/sq_game
|
||||
CHECKERS /HD0/1/KOLIBRI/BIN/checkers
|
||||
QUAKE HD0_1 /HD0/1/MENUETOS/sdlquake
|
||||
DOOM HD0_1 /HD0/1/MENUETOS/doom/mdoom
|
||||
SOKOBAN HD0_1 /HD0/1/KOLIBRI/BIN/soko
|
||||
#7 **** EXAMPLES ****
|
||||
THREADS /HD0/1/KOLIBRI/BIN/thread
|
||||
IPC /HD0/1/KOLIBRI/BIN/ipc
|
||||
COLOR SLIDER /HD0/1/KOLIBRI/BIN/cslide
|
||||
CONSOLE EXAMPLE /HD0/1/KOLIBRI/BIN/testcon2
|
||||
#8 **** SETUP ****
|
||||
DEVICES SETUP /HD0/1/KOLIBRI/BIN/setup
|
||||
BACKGROUND SETUP /HD0/1/KOLIBRI/BIN/pic4
|
||||
MEVIEW /HD0/1/KOLIBRI/BIN/mv
|
||||
JPEGVIEW /HD0/1/KOLIBRI/BIN/jpegview
|
||||
COLORS & SKIN SETUP /HD0/1/KOLIBRI/BIN/desktop
|
||||
PANEL SETUP /HD0/1/KOLIBRI/BIN/spanel
|
||||
ICONS SETUP /HD0/1/KOLIBRI/BIN/icon
|
||||
VRR /HD0/1/KOLIBRI/BIN/vrr
|
||||
#9 **** SERVERS ****
|
||||
SMTPS /HD0/1/KOLIBRI/BIN/smtps
|
||||
HTTPS /HD0/1/KOLIBRI/BIN/https
|
||||
MP3S /HD0/1/KOLIBRI/BIN/mp3s
|
||||
FTPS /HD0/1/KOLIBRI/BIN/ftps
|
||||
NETSENDS /HD0/1/KOLIBRI/BIN/netsends
|
||||
RCC-SERVER /HD0/1/KOLIBRI/BIN/rccs
|
||||
#10 **** CLIENTS ****
|
||||
TFTP CLIENT /HD0/1/KOLIBRI/BIN/tftpc
|
||||
INTERNET-CHESS /HD0/1/KOLIBRI/BIN/chess
|
||||
SIMPLY BROWSER /HD0/1/KOLIBRI/BIN/httpc
|
||||
NNTP-NEWSGROUPS /HD0/1/KOLIBRI/BIN/nntpc
|
||||
TELNET /HD0/1/KOLIBRI/BIN/telnet
|
||||
POP - MAIL /HD0/1/KOLIBRI/BIN/popc
|
||||
TFTP AUDIO STREAM /HD0/1/KOLIBRI/BIN/tftpa
|
||||
IRC CLIENT /HD0/1/KOLIBRI/BIN/airc
|
||||
YAHOO MESSENG.(DEMO) /HD0/1/KOLIBRI/BIN/ym
|
||||
NETSENDC /HD0/1/KOLIBRI/BIN/netsendc
|
||||
TESTFTP1 /HD0/1/KOLIBRI/BIN/testftp1
|
||||
RCC-CLIENT /HD0/1/KOLIBRI/BIN/rccc
|
||||
JMAIL /rd/1/network/jmail
|
||||
#11 **** AUDIO ****
|
||||
SB AUDIO PLAYER /HD0/1/KOLIBRI/BIN/sb
|
||||
MIDAMP /HD0/1/KOLIBRI/BIN/midamp
|
||||
CD PLAYER /HD0/1/KOLIBRI/BIN/cdp
|
||||
VOLUME /HD0/1/KOLIBRI/BIN/mixer
|
||||
TEST MIDI /HD0/1/KOLIBRI/BIN/midiplay
|
||||
#12 **** GRAPHICS ****
|
||||
ICON EDITOR (BMP) /HD0/1/KOLIBRI/BIN/iconedit
|
||||
JPEG VIEWER /HD0/1/KOLIBRI/BIN/jpegview
|
||||
BMP VIEWER /HD0/1/KOLIBRI/BIN/mv
|
||||
GIFVIEW /HD0/1/KOLIBRI/BIN/gifview
|
||||
ANIMAGE /HD0/1/KOLIBRI/BIN/animage
|
||||
#13 **** <20>€<EFBFBD><E282AC>’€ ‘ ”€‰‹€Œˆ ****
|
||||
CMD CONSOLE /HD0/1/KOLIBRI/BIN/cmd
|
||||
SYSXTREE /HD0/1/KOLIBRI/BIN/sysxtree
|
||||
KFAR /HD0/1/KOLIBRI/BIN/kfar
|
||||
COPY FILE /HD0/1/KOLIBRI/BIN/copy2
|
||||
SAVE RD IMAGE /HD0/1/KOLIBRI/BIN/rdsave
|
||||
#14
|
||||
PROCESSES (CPU) /HD0/1/KOLIBRI/BIN/cpu
|
||||
PCI DEVICES /HD0/1/KOLIBRI/BIN/pcidev
|
||||
TEST GRAPHICS SPEED /HD0/1/KOLIBRI/BIN/mgb
|
||||
CPUID /HD0/1/KOLIBRI/BIN/cpuid
|
||||
GHOST MONITOR /HD0/1/KOLIBRI/BIN/gmon
|
||||
K. BUS DISCONNECTED /HD0/1/KOLIBRI/BIN/kbd
|
||||
#15
|
||||
SCREENSAVER /HD0/1/KOLIBRI/BIN/crownscr
|
||||
3D-CUBE /HD0/1/KOLIBRI/BIN/3dcube2
|
||||
3D-LABYRINTH /HD0/1/KOLIBRI/BIN/free3d04
|
||||
3D-TEXTURED CUBE /HD0/1/KOLIBRI/BIN/3dtcub10
|
||||
3DSHEART /HD0/1/KOLIBRI/BIN/3dsheart
|
||||
VIEW3DS /HD0/1/KOLIBRI/BIN/view3ds
|
||||
CUBELINE /HD0/1/KOLIBRI/BIN/cubeline
|
||||
3D-TEXTURED CUBE 2 /HD0/1/KOLIBRI/BIN/cubetext
|
||||
GEARS /HD0/1/KOLIBRI/BIN/gears
|
||||
FLATWAV /HD0/1/KOLIBRI/BIN/flatwav
|
||||
##
|
@ -1,2 +0,0 @@
|
||||
echo lang fix en >lang.inc
|
||||
fasm menu.asm menu
|
@ -1,269 +0,0 @@
|
||||
; new application structure
|
||||
macro meos_app_start
|
||||
{
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
db 'MENUET01'
|
||||
dd 0x01
|
||||
dd __start
|
||||
dd __end
|
||||
dd __memory
|
||||
dd __stack
|
||||
|
||||
if used __params & ~defined __params
|
||||
dd __params
|
||||
else
|
||||
dd 0x0
|
||||
end if
|
||||
|
||||
dd 0x0
|
||||
}
|
||||
MEOS_APP_START fix meos_app_start
|
||||
|
||||
macro code
|
||||
{
|
||||
__start:
|
||||
}
|
||||
CODE fix code
|
||||
|
||||
macro data
|
||||
{
|
||||
__data:
|
||||
}
|
||||
DATA fix data
|
||||
|
||||
macro udata
|
||||
{
|
||||
if used __params & ~defined __params
|
||||
__params:
|
||||
db 0
|
||||
__end:
|
||||
rb 255
|
||||
else
|
||||
__end:
|
||||
end if
|
||||
__udata:
|
||||
}
|
||||
UDATA fix udata
|
||||
|
||||
macro meos_app_end
|
||||
{
|
||||
align 32
|
||||
rb 2048
|
||||
__stack:
|
||||
__memory:
|
||||
}
|
||||
MEOS_APP_END fix meos_app_end
|
||||
|
||||
|
||||
; macro for defining multiline text data
|
||||
struc mstr [sstring]
|
||||
{
|
||||
forward
|
||||
local ssize
|
||||
virtual at 0
|
||||
db sstring
|
||||
ssize = $
|
||||
end virtual
|
||||
dd ssize
|
||||
db sstring
|
||||
common
|
||||
dd -1
|
||||
}
|
||||
|
||||
|
||||
; strings
|
||||
macro sz name,[data] { ; from MFAR [mike.dld]
|
||||
common
|
||||
if used name
|
||||
label name
|
||||
end if
|
||||
forward
|
||||
if used name
|
||||
db data
|
||||
end if
|
||||
common
|
||||
if used name
|
||||
.size = $-name
|
||||
end if
|
||||
}
|
||||
|
||||
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
|
||||
common
|
||||
if used name
|
||||
label name
|
||||
end if
|
||||
forward
|
||||
if (used name)&(lang eq lng)
|
||||
db data
|
||||
end if
|
||||
common
|
||||
if used name
|
||||
.size = $-name
|
||||
end if
|
||||
}
|
||||
|
||||
|
||||
|
||||
; easy system call macro
|
||||
macro mpack dest, hsrc, lsrc
|
||||
{
|
||||
if (hsrc eqtype 0) & (lsrc eqtype 0)
|
||||
mov dest, (hsrc) shl 16 + lsrc
|
||||
else
|
||||
if (hsrc eqtype 0) & (~lsrc eqtype 0)
|
||||
mov dest, (hsrc) shl 16
|
||||
add dest, lsrc
|
||||
else
|
||||
mov dest, hsrc
|
||||
shl dest, 16
|
||||
add dest, lsrc
|
||||
end if
|
||||
end if
|
||||
}
|
||||
|
||||
macro __mov reg,a,b { ; mike.dld
|
||||
if (~a eq)&(~b eq)
|
||||
mpack reg,a,b
|
||||
else if (~a eq)&(b eq)
|
||||
mov reg,a
|
||||
end if
|
||||
}
|
||||
|
||||
macro mcall a,b,c,d,e,f { ; mike.dld
|
||||
__mov eax,a
|
||||
__mov ebx,b
|
||||
__mov ecx,c
|
||||
__mov edx,d
|
||||
__mov esi,e
|
||||
__mov edi,f
|
||||
int 0x40
|
||||
}
|
||||
|
||||
|
||||
|
||||
; optimize the code for size
|
||||
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
|
||||
|
||||
macro add arg1,arg2
|
||||
{
|
||||
if (arg2 eqtype 0)
|
||||
if (arg2) = 1
|
||||
inc arg1
|
||||
else
|
||||
add arg1,arg2
|
||||
end if
|
||||
else
|
||||
add arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
macro sub arg1,arg2
|
||||
{
|
||||
if (arg2 eqtype 0)
|
||||
if (arg2) = 1
|
||||
dec arg1
|
||||
else
|
||||
sub arg1,arg2
|
||||
end if
|
||||
else
|
||||
sub arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
macro mov arg1,arg2
|
||||
{
|
||||
if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
|
||||
if (arg2) = 0
|
||||
xor arg1,arg1
|
||||
else if (arg2) = 1
|
||||
xor arg1,arg1
|
||||
inc arg1
|
||||
else if (arg2) = -1
|
||||
or arg1,-1
|
||||
else if (arg2) > -128 & (arg2) < 128
|
||||
push arg2
|
||||
pop arg1
|
||||
else
|
||||
mov arg1,arg2
|
||||
end if
|
||||
else
|
||||
mov arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
|
||||
macro struct name
|
||||
{
|
||||
virtual at 0
|
||||
name name
|
||||
sizeof.#name = $ - name
|
||||
end virtual
|
||||
}
|
||||
|
||||
; structures used in MeOS
|
||||
struc process_information
|
||||
{
|
||||
.cpu_usage dd ? ; +0
|
||||
.window_stack_position dw ? ; +4
|
||||
.window_stack_value dw ? ; +6
|
||||
.not_used1 dw ? ; +8
|
||||
.process_name rb 12 ; +10
|
||||
.memory_start dd ? ; +22
|
||||
.used_memory dd ? ; +26
|
||||
.PID dd ? ; +30
|
||||
.x_start dd ? ; +34
|
||||
.y_start dd ? ; +38
|
||||
.x_size dd ? ; +42
|
||||
.y_size dd ? ; +46
|
||||
.slot_state dw ? ; +50
|
||||
dw ? ; +52 - reserved
|
||||
.client_left dd ? ; +54
|
||||
.client_top dd ? ; +58
|
||||
.client_width dd ? ; +62
|
||||
.client_height dd ? ; +66
|
||||
.wnd_state db ? ; +70
|
||||
rb (1024-71)
|
||||
}
|
||||
struct process_information
|
||||
|
||||
struc system_colors
|
||||
{
|
||||
.frame dd ?
|
||||
.grab dd ?
|
||||
.grab_button dd ?
|
||||
.grab_button_text dd ?
|
||||
.grab_text dd ?
|
||||
.work dd ?
|
||||
.work_button dd ?
|
||||
.work_button_text dd ?
|
||||
.work_text dd ?
|
||||
.work_graph dd ?
|
||||
}
|
||||
struct system_colors
|
||||
|
||||
|
||||
; constants
|
||||
|
||||
; events
|
||||
EV_IDLE = 0
|
||||
EV_TIMER = 0
|
||||
EV_REDRAW = 1
|
||||
EV_KEY = 2
|
||||
EV_BUTTON = 3
|
||||
EV_EXIT = 4
|
||||
EV_BACKGROUND = 5
|
||||
EV_MOUSE = 6
|
||||
EV_IPC = 7
|
||||
EV_STACK = 8
|
||||
|
||||
; event mask bits for function 40
|
||||
EVM_REDRAW = 1b
|
||||
EVM_KEY = 10b
|
||||
EVM_BUTTON = 100b
|
||||
EVM_EXIT = 1000b
|
||||
EVM_BACKGROUND = 10000b
|
||||
EVM_MOUSE = 100000b
|
||||
EVM_IPC = 1000000b
|
||||
EVM_STACK = 10000000b
|
@ -1,566 +0,0 @@
|
||||
;******************************************************************************
|
||||
; MAIN MENU by lisovin@26.ru
|
||||
; Some parts of code rewritten by Ivan Poddubny <ivan-yar@bk.ru>
|
||||
;
|
||||
; Compile with FASM for Menuet
|
||||
;******************************************************************************
|
||||
include "lang.inc"
|
||||
include "macros.inc"
|
||||
|
||||
BTN_HEIGHT = 22
|
||||
TXT_Y = (BTN_HEIGHT)/2-5
|
||||
|
||||
use32
|
||||
org 0x0
|
||||
db 'MENUET01' ; 8 byte id
|
||||
dd 0x01 ; header version
|
||||
dd START ; start of code
|
||||
dd I_END ; size of image
|
||||
dd 0x20000 ; memory for app
|
||||
dd 0x20000-1 ; esp
|
||||
dd 0x0 , 0x0 ; I_Param , I_Icon
|
||||
;******************************************************************************
|
||||
;include "DEBUG.INC" ; debug macros
|
||||
START: ; start of execution
|
||||
|
||||
mov eax, 48 ; load system colors
|
||||
mov ebx, 3
|
||||
mov ecx, sc
|
||||
mov edx, sizeof.system_colors
|
||||
int 0x40
|
||||
|
||||
mov eax, 70 ; load MENU.DAT
|
||||
mov ebx, fileinfo
|
||||
int 0x40
|
||||
test eax, eax ; error ?
|
||||
jz @f
|
||||
cmp eax,6
|
||||
jnz close
|
||||
@@:
|
||||
test ebx, ebx ; length = 0 ?
|
||||
jz close
|
||||
mov ecx, ebx
|
||||
mov edi, mem_end
|
||||
newsearch:
|
||||
mov al, '#'
|
||||
cld
|
||||
repne scasb
|
||||
test ecx, ecx ; if not found
|
||||
jz close
|
||||
call get_number
|
||||
test ebx, ebx
|
||||
jnz .number
|
||||
cmp al, '#'
|
||||
je search_end
|
||||
.number:
|
||||
shl ebx, 4
|
||||
add ebx, menu_data ; pointer to process table
|
||||
mov [ebx], edi
|
||||
inc [processes]
|
||||
jmp newsearch
|
||||
search_end:
|
||||
mov [end_pointer], edi
|
||||
mov ebx, [processes]
|
||||
dec ebx
|
||||
shl ebx, 4
|
||||
add ebx, menu_data
|
||||
newprocess:
|
||||
xor edx, edx
|
||||
mov ecx, edi
|
||||
sub ecx, [ebx]
|
||||
mov al, 10
|
||||
newsearch1:
|
||||
std
|
||||
repne scasb
|
||||
test ecx, ecx
|
||||
je endprocess
|
||||
cmp [edi], byte 13
|
||||
jne newsearch1
|
||||
inc edx
|
||||
jmp newsearch1
|
||||
endprocess:
|
||||
mov esi, ebx
|
||||
add esi, 4
|
||||
dec edx
|
||||
mov [esi], dl
|
||||
cmp ebx, menu_data
|
||||
jbe search_end1
|
||||
sub ebx, 16
|
||||
jmp newprocess
|
||||
search_end1:
|
||||
mov eax, 14
|
||||
int 0x40
|
||||
sub ax, 20
|
||||
mov [menu_data + y_end], ax
|
||||
mov [menu_data + x_start], 5
|
||||
mov al, [menu_data + rows]
|
||||
mov [menu_data + cur_sel], al ; clear selection
|
||||
mov [menu_data + prev_sel], al
|
||||
|
||||
mov [buffer], 0
|
||||
thread:
|
||||
mov eax, [buffer] ; identifier
|
||||
shl eax, 4
|
||||
add eax, menu_data
|
||||
mov edi, eax
|
||||
|
||||
mov eax, 40 ; set event mask
|
||||
mov ebx, 100111b ; mouse + button + key + redraw
|
||||
int 0x40
|
||||
|
||||
call draw_window
|
||||
|
||||
still:
|
||||
mov eax, 23 ; wait here for event
|
||||
mov ebx, 5
|
||||
int 0x40
|
||||
|
||||
test [close_now], 1 ; is close flag set?
|
||||
jnz close
|
||||
|
||||
cmp eax, 1 ; redraw request ?
|
||||
je red
|
||||
cmp eax, 2 ; key pressed ?
|
||||
je key
|
||||
cmp eax, 3 ; button in buffer ?
|
||||
je button
|
||||
cmp eax, 6 ; mouse event ?
|
||||
je mouse
|
||||
|
||||
cmp edi, menu_data
|
||||
je still ; if main process-ignored
|
||||
|
||||
movzx ebx, [edi + parent] ; parent id
|
||||
shl ebx, 4
|
||||
add ebx, menu_data ; ebx = base of parent info
|
||||
call backconvert ; get my id in al
|
||||
cmp al, [ebx + child] ; if I'm not child of my parent, I shall die :)
|
||||
jne close
|
||||
|
||||
jmp still
|
||||
|
||||
|
||||
red: ; redraw
|
||||
call draw_window
|
||||
jmp still
|
||||
|
||||
|
||||
key:
|
||||
; mov eax, 2
|
||||
int 0x40
|
||||
|
||||
mov al, [edi + rows] ; number of buttons
|
||||
|
||||
cmp ah, 178 ; KEY_UP
|
||||
jne .noup
|
||||
|
||||
mov ah, [edi+cur_sel]
|
||||
mov [edi+prev_sel], ah
|
||||
dec byte [edi+cur_sel]
|
||||
jnz redrawbut
|
||||
mov [edi+cur_sel], al
|
||||
jmp redrawbut
|
||||
|
||||
|
||||
.noup:
|
||||
cmp ah, 177 ; KEY_DOWN
|
||||
jne .nodn
|
||||
|
||||
mov ah, [edi + cur_sel]
|
||||
mov [edi + prev_sel], ah
|
||||
inc [edi + cur_sel]
|
||||
cmp [edi + cur_sel], al
|
||||
jna redrawbut
|
||||
mov [edi + cur_sel], 1
|
||||
jmp redrawbut
|
||||
|
||||
.nodn:
|
||||
cmp ah, 13 ; ENTER
|
||||
jne .noenter
|
||||
mov ah, [edi + cur_sel]
|
||||
jmp button1
|
||||
|
||||
.noenter:
|
||||
cmp ah, 27 ; ESC
|
||||
jne still
|
||||
jmp close
|
||||
|
||||
; include "DEBUG.INC"
|
||||
|
||||
button: ; BUTTON HANDLER
|
||||
mov eax, 17 ; get id
|
||||
int 0x40
|
||||
|
||||
button1:
|
||||
mov esi, edi
|
||||
push edi
|
||||
mov edi, [edi + pointer]
|
||||
|
||||
; print "hello"
|
||||
mov al, [esi + cur_sel]
|
||||
mov [esi + prev_sel], al
|
||||
mov [esi + cur_sel], ah
|
||||
pushad
|
||||
mov edi, esi
|
||||
; dph eax
|
||||
call draw_only_needed_buttons
|
||||
popad
|
||||
|
||||
; look for the next line <ah> times; <ah> = button_id
|
||||
push eax
|
||||
.next_string:
|
||||
call searchstartstring
|
||||
dec ah
|
||||
jnz .next_string
|
||||
pop eax
|
||||
|
||||
mov ecx, 40
|
||||
mov al, '/'
|
||||
cld
|
||||
repne scasb
|
||||
test ecx, ecx ; if '/' not found
|
||||
je searchexit
|
||||
|
||||
cmp [edi], byte '@' ; check for submenu
|
||||
je runthread
|
||||
|
||||
dec edi
|
||||
push edi ; pointer to start of filename
|
||||
call searchstartstring ; search for next string
|
||||
sub edi, 2 ; to last byte of string
|
||||
|
||||
mov ecx, edi
|
||||
pop esi
|
||||
sub ecx, esi
|
||||
inc ecx ; length of filename
|
||||
mov edi, fileinfo_start.name
|
||||
rep movsb ; copy string
|
||||
mov byte [edi], 0 ; store terminator
|
||||
mov eax, 70 ; start program
|
||||
mov ebx, fileinfo_start
|
||||
int 0x40
|
||||
; mcall 5,100
|
||||
or [close_now], 1 ; set close flag
|
||||
pop edi
|
||||
mov [mousemask], 0
|
||||
jmp close
|
||||
|
||||
searchexit:
|
||||
pop edi
|
||||
jmp still
|
||||
|
||||
|
||||
runthread:
|
||||
inc edi
|
||||
|
||||
push eax
|
||||
call get_number ; get number of this process
|
||||
pop eax
|
||||
|
||||
test ebx, ebx ; returned zero - main menu or not number
|
||||
jz searchexit
|
||||
|
||||
mov al, bl
|
||||
|
||||
mov ebx, [processes]
|
||||
dec bl
|
||||
cmp al, bl
|
||||
ja searchexit ; such process doesnt exist
|
||||
cmp al, [esi + child]
|
||||
je searchexit ; such process already exists
|
||||
|
||||
mov [esi + child], al ; this is my child
|
||||
mov cx, [esi + x_start]
|
||||
add cx, 141 ; new x_start in cx
|
||||
movzx edx, al
|
||||
shl edx, 4
|
||||
add edx, menu_data ; edx points to child's base address
|
||||
mov [edx + x_start], cx ; xstart for new thread
|
||||
mov cx, [esi + y_end] ; y_end in cx
|
||||
mov bl, [esi + rows] ; number of buttons in bl
|
||||
sub bl, ah ; number of btn from bottom
|
||||
movzx eax, al
|
||||
mov [buffer], eax ; thread id in buffer
|
||||
movzx ebx, bl
|
||||
push edx
|
||||
mov eax, BTN_HEIGHT
|
||||
mul ebx
|
||||
sub cx, ax ; new y_end for new thread
|
||||
pop edx
|
||||
mov [edx + y_end], cx ; store y_end
|
||||
mov edi, esi
|
||||
call backconvert ; get number of this process (al)
|
||||
mov [edx + parent], al ; store number of parent process
|
||||
mov al, [edx + rows]
|
||||
mov [edx + cur_sel], al ; clear current selected element
|
||||
mov [edx + prev_sel], al ; clear previous selected element
|
||||
mov [edx + child], 0
|
||||
|
||||
cmp [thread_stack], 0x1e000
|
||||
jne thread_stack_not_full
|
||||
mov [thread_stack], 0xE000
|
||||
|
||||
thread_stack_not_full:
|
||||
add [thread_stack], 0x2000 ; start new thread
|
||||
mov eax, 51
|
||||
mov ebx, 1
|
||||
mov ecx, thread
|
||||
mov edx, [thread_stack]
|
||||
int 0x40
|
||||
|
||||
jmp searchexit
|
||||
|
||||
|
||||
mouse: ; MOUSE EVENT HANDLER
|
||||
mov eax, 37
|
||||
mov ebx, 2
|
||||
int 0x40
|
||||
test eax, eax ; check buttons state
|
||||
jnz click
|
||||
mov eax, 37
|
||||
mov ebx, 1
|
||||
int 0x40
|
||||
ror eax, 16 ; eax = [ Y | X ] relative to window
|
||||
cmp ax, 140 ; pointer in window?
|
||||
ja noinwindow
|
||||
; in window
|
||||
|
||||
shr eax, 16 ; eax = [ 0 | Y ]
|
||||
xor edx, edx
|
||||
mov ebx, BTN_HEIGHT
|
||||
div ebx
|
||||
inc eax ; number of "button" in eax
|
||||
movzx ebx, [edi + rows] ; total strings in ebx
|
||||
cmp eax, ebx
|
||||
ja noinwindow
|
||||
cmp [edi + cur_sel], al
|
||||
je noredrawbut
|
||||
mov bl, [edi + cur_sel]
|
||||
|
||||
;;;;;;
|
||||
cmp [edi + child], 0
|
||||
jne noredrawbut
|
||||
;;;;;;
|
||||
|
||||
mov [edi + cur_sel], al
|
||||
mov [edi + prev_sel], bl
|
||||
redrawbut:
|
||||
call draw_only_needed_buttons
|
||||
noredrawbut:
|
||||
call backconvert
|
||||
bts [mousemask], eax
|
||||
jmp still
|
||||
noinwindow:
|
||||
call backconvert
|
||||
btr [mousemask], eax
|
||||
jmp still
|
||||
click:
|
||||
cmp [mousemask], 0 ; not in a window (i.e. menu)
|
||||
je close
|
||||
jmp still
|
||||
|
||||
|
||||
close:
|
||||
or eax, -1 ; close this thread
|
||||
mov [edi + child], al ; my child is not mine
|
||||
int 0x40
|
||||
|
||||
|
||||
backconvert: ; convert from pointer to process id
|
||||
mov eax, edi
|
||||
sub eax, menu_data
|
||||
shr eax, 4
|
||||
ret
|
||||
|
||||
|
||||
;==================================
|
||||
; get_number
|
||||
; load number from [edi] to ebx
|
||||
;==================================
|
||||
get_number:
|
||||
push edi
|
||||
|
||||
xor eax, eax
|
||||
xor ebx, ebx
|
||||
|
||||
.get_next_char:
|
||||
mov al, [edi]
|
||||
inc edi
|
||||
cmp al, '0'
|
||||
jb .finish
|
||||
cmp al, '9'
|
||||
ja .finish
|
||||
sub al, '0'
|
||||
imul ebx, 10
|
||||
add ebx, eax
|
||||
jmp .get_next_char
|
||||
|
||||
.finish:
|
||||
pop edi
|
||||
ret
|
||||
|
||||
|
||||
; *********************************************
|
||||
; ******* WINDOW DEFINITIONS AND DRAW ********
|
||||
; *********************************************
|
||||
|
||||
|
||||
draw_window:
|
||||
|
||||
mov eax, 12 ; function 12:tell os about windowdraw
|
||||
mov ebx, 1 ; 1, start of draw
|
||||
int 0x40
|
||||
|
||||
movzx ebx, [edi + rows]
|
||||
imul eax, ebx, BTN_HEIGHT ; eax = height of window
|
||||
movzx ecx, [edi + y_end]
|
||||
sub ecx, eax ; ecx = Y_START
|
||||
shl ecx, 16
|
||||
add ecx, eax ; ecx = [ Y_START | Y_SIZE ]
|
||||
dec ecx
|
||||
movzx ebx, [edi + x_start]
|
||||
shl ebx, 16
|
||||
mov bx, 140 ; ebx = [ X_START | X_SIZE ]
|
||||
xor eax, eax ; function 0 : define and draw window
|
||||
mov edx, 0x01000000 ; color of work area RRGGBB,8->color gl
|
||||
mov esi, edx ; unmovable window
|
||||
int 0x40
|
||||
|
||||
call draw_all_buttons
|
||||
|
||||
mov eax,12
|
||||
mov ebx,2
|
||||
int 0x40
|
||||
|
||||
ret
|
||||
|
||||
|
||||
draw_all_buttons:
|
||||
xor edx, edx
|
||||
.new_button:
|
||||
call draw_one_button
|
||||
inc edx
|
||||
cmp dl, [edi + rows]
|
||||
jb .new_button
|
||||
|
||||
ret
|
||||
|
||||
|
||||
draw_only_needed_buttons:
|
||||
xor edx, edx
|
||||
mov dl, [edi + cur_sel]
|
||||
dec dl
|
||||
call draw_one_button
|
||||
mov dl, [edi + prev_sel]
|
||||
dec dl
|
||||
call draw_one_button
|
||||
ret
|
||||
|
||||
|
||||
draw_one_button:
|
||||
; receives number of button in dl
|
||||
push edx;ad
|
||||
|
||||
mov eax, 8
|
||||
mov ebx, 140
|
||||
movzx ecx, dl
|
||||
imul ecx, BTN_HEIGHT
|
||||
shl ecx, 16
|
||||
add ecx, BTN_HEIGHT-1
|
||||
; edx = button identifier
|
||||
mov esi, [sc.work]
|
||||
inc dl
|
||||
cmp [edi + cur_sel], dl
|
||||
jne .nohighlight
|
||||
add esi, 0x101010
|
||||
.nohighlight:
|
||||
or edx, 0x20000000
|
||||
int 0x40
|
||||
movzx edx, dl
|
||||
|
||||
dec dl
|
||||
imul ebx, edx, BTN_HEIGHT
|
||||
add ebx, (4 shl 16) + TXT_Y
|
||||
|
||||
movzx ecx, dl
|
||||
inc ecx
|
||||
mov edx, [edi + pointer]
|
||||
.findline:
|
||||
cmp byte [edx], 13
|
||||
je .linefound
|
||||
inc edx
|
||||
jmp .findline
|
||||
.linefound:
|
||||
inc edx
|
||||
cmp byte [edx], 10
|
||||
jne .findline
|
||||
dec ecx
|
||||
jnz .findline
|
||||
|
||||
mov ecx, [sc.work_text]
|
||||
mov eax, 4
|
||||
mov esi, 21
|
||||
int 0x40
|
||||
|
||||
pop edx;ad
|
||||
ret
|
||||
|
||||
|
||||
searchstartstring:
|
||||
mov ecx, 40
|
||||
mov al, 13
|
||||
cld
|
||||
repne scasb
|
||||
cmp byte [edi], 10
|
||||
jne searchstartstring
|
||||
ret
|
||||
|
||||
|
||||
;*** DATA AREA ****************************************************************
|
||||
|
||||
thread_stack dd 0xE000
|
||||
processes dd 0
|
||||
|
||||
fileinfo:
|
||||
.subfunction dd 0 ; 0=READ
|
||||
.start dd 0 ; start byte
|
||||
.size_high dd 0 ; rezerved
|
||||
.size dd 0x10000-mem_end ; blocks to read
|
||||
.return dd mem_end ; return data pointer
|
||||
.name:
|
||||
db '/HD0/1/KOLIBRI/ETC/MENU.DAT',0 ; ASCIIZ dir & filename
|
||||
|
||||
fileinfo_start:
|
||||
.subfunction dd 7 ; 7=START APPLICATION
|
||||
.flags dd 0 ; flags
|
||||
.params dd 0x0 ; nop
|
||||
.rezerved dd 0x0 ; nop
|
||||
.rezerved_1 dd 0x0 ; nop
|
||||
.name:
|
||||
times 50 db ' '
|
||||
|
||||
I_END:
|
||||
|
||||
close_now dd ? ; close all processes immediately
|
||||
end_pointer dd ?
|
||||
buffer dd ?
|
||||
mousemask dd ? ; mask for mouse pointer location
|
||||
|
||||
sc system_colors
|
||||
|
||||
menu_data:
|
||||
rb 0x4000 ;x10000
|
||||
|
||||
virtual at 0 ; PROCESSES TABLE (located at menu_data)
|
||||
pointer dd ? ; +0 pointer in file
|
||||
rows db ? ; +4 numer of strings
|
||||
x_start dw ? ; +5 x start
|
||||
y_end dw ? ; +7 y end
|
||||
child db ? ; +9 id of child menu
|
||||
parent db ? ; +10 id of parent menu
|
||||
cur_sel db ? ; +11 current selection
|
||||
prev_sel db ? ; +12 previous selection
|
||||
rb 16-$+1 ; [16 bytes per element]
|
||||
end virtual
|
||||
|
||||
mem_end:
|
@ -1,73 +0,0 @@
|
||||
English text is below
|
||||
НОВОЕ ГЛАВНОЕ МЕНЮ.
|
||||
Внимание: для корректной работы рекомендуется MENUET не ниже 0.76
|
||||
и цветной монитор (на монохромном подсветка не видна)
|
||||
|
||||
Отличия от Виллиного меню:
|
||||
1.Конфигурируемость. Пункты как основного, так и дополнительных
|
||||
менюшек задаются файлом MENU.DAT.
|
||||
Это позволяет:
|
||||
-добавлять/убирать любые пункты в меню. Программа сама анализирует
|
||||
изменения и рисует окно с кнопками по количеству пунктов.В дальнейшем
|
||||
имхо это позволит конфигурировать меню не только вручную, но и прог-
|
||||
раммно. Никакого вмешательства в код, что позволяет конфигурить меню
|
||||
и простым пользователям.
|
||||
-переводить меню на любые языки, не лазя в код.
|
||||
-поскольку запуск приложений через 58-ю функцию, приложения могут находить-
|
||||
ся не только на рамдиске.
|
||||
2.Вещица, совсем не интересная для пользователей, но возможно
|
||||
представляющая интерес для программистов. Приложение многопоточное, но все
|
||||
потоки запускаются на одном и том же коде. Это позволило заменить испол-
|
||||
няемые файлы MENU, SELECT1, SELECT2 и т.д. одним-единственным MENU
|
||||
и сильно сэкономить место на диске.
|
||||
3.Самоуничтожаемость меню при клике за его пределами и при запуске приложения
|
||||
4.Кнопки, подсвечиваемые при наведении на них мышью (на монохромном мониторе
|
||||
подсветка не видна).
|
||||
5.Поддержка клавиатуры. Кнопки Вверх, Вниз, Enter и Esc.
|
||||
В общем, постарался приблизиться к виндовской менюшке.
|
||||
|
||||
Замечания по синтаксису файла MENU.DAT:
|
||||
Размер файла MENU.DAT-не более 2К
|
||||
Меню #0-всегда главное.
|
||||
Количество меню-не более 10 - от #0 до #9
|
||||
В каждой строке либо путь на исполняемый файл, либо ссылка на дочернее
|
||||
меню, например /@5
|
||||
Маркер конца ## обязателен (внимание! TINYPAD бывает его обрезает)
|
||||
Под текст на менюшных кнопках отводятся первые 20 позиций каждой строки
|
||||
Каждая строка отделяется ENTERом, т.е. должны присутствовать знаки пере-
|
||||
вода строки 0x0d,0x0a
|
||||
|
||||
Прога ОЧЕНЬ сырая, поэтому просьба не удивляться, если что-нить не будет
|
||||
работать. С файлом MENU.DAT просьба обращаться очень осторожно. TINYPAD
|
||||
иногда его калечит. Особенно маркер конца файла!
|
||||
Исполняемый файл очень рекомендуется назвать MENU. (при компиляции)
|
||||
Тогда он будет вызываться из панели как и положено.
|
||||
Все замечания и предложения с удовольствием принимаются на lisovin@26.ru
|
||||
Приаттаченные файлы следует высылать на mutny@rambler.ru
|
||||
С уважением,
|
||||
Михаил Лисовин
|
||||
|
||||
NEW MAIN MENU
|
||||
Requirements: MENUET 0.76, color monitor
|
||||
WHAT'S NEW?
|
||||
1.Self-configuring menu. All the configurational data is in MENU.DAT
|
||||
You may add/remove menu positions, translate menu to any language,
|
||||
run menu applications from HDD without source code change.
|
||||
2.Multi-thread application. There're two files only: MENU and MENU.DAT
|
||||
instead of MENU, SELECT1, SELECT2, SELECT3 etc.
|
||||
3.Self-closing when running application or clicking out of menu.
|
||||
4.Button highlight
|
||||
5.Keyboard support (keys Up, Dn, Enter, Esc.)
|
||||
So, it's just like Windows menu ;)
|
||||
NOTES ON MENU.DAT:
|
||||
Size of MENU.DAT should be not more than 2K
|
||||
Number of menus-not more than 10 (from #0 to #9). #0 is always main menu
|
||||
## is an end file marker - always required.
|
||||
First 20 positions of any string reserved for button text
|
||||
Any string contains file path or link to submenu, for example /@4.
|
||||
You may edit MENU.DAT by any text editor, but be careful when using
|
||||
TINYPAD (sometimes it cuts end marker).
|
||||
It is recommended to compile MMENU.ASM as MENU. So, you can run it from
|
||||
standard panel.
|
||||
All the comments and bugreports send to lisovin@26.ru
|
||||
Michail Lisovin.
|
@ -1,6 +0,0 @@
|
||||
Changes:
|
||||
11.07.06 - Mario79, application used function 70.
|
||||
Earlier changes were made:
|
||||
Ivan Poddubny, Mario79 and Halyavin
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
||||
0000;0000;0001;0001;0001;0001;0100;0001;0001;0001;0001;0001;x
|
@ -1,4 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix en >lang.inc
|
||||
@fasm @panel.asm @panel
|
||||
@pause
|
@ -1,5 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix et >lang.inc
|
||||
@fasm @panel.asm @panel
|
||||
@erase lang.inc
|
||||
@pause
|
@ -1,4 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix ru >lang.inc
|
||||
@fasm @panel.asm @panel
|
||||
@pause
|
@ -1,266 +0,0 @@
|
||||
; new application structure
|
||||
macro meos_app_start
|
||||
{
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
db 'MENUET01'
|
||||
dd 0x01
|
||||
dd __start
|
||||
dd __end
|
||||
dd __memory
|
||||
dd __stack
|
||||
|
||||
if used __params & ~defined __params
|
||||
dd __params
|
||||
else
|
||||
dd 0x0
|
||||
end if
|
||||
|
||||
dd 0x0
|
||||
}
|
||||
MEOS_APP_START fix meos_app_start
|
||||
|
||||
macro code
|
||||
{
|
||||
__start:
|
||||
}
|
||||
CODE fix code
|
||||
|
||||
macro data
|
||||
{
|
||||
__data:
|
||||
}
|
||||
DATA fix data
|
||||
|
||||
macro udata
|
||||
{
|
||||
if used __params & ~defined __params
|
||||
__params:
|
||||
db 0
|
||||
__end:
|
||||
rb 255
|
||||
else
|
||||
__end:
|
||||
end if
|
||||
__udata:
|
||||
}
|
||||
UDATA fix udata
|
||||
|
||||
macro meos_app_end
|
||||
{
|
||||
align 32
|
||||
rb 2048
|
||||
__stack:
|
||||
__memory:
|
||||
}
|
||||
MEOS_APP_END fix meos_app_end
|
||||
|
||||
|
||||
; macro for defining multiline text data
|
||||
struc mstr [sstring]
|
||||
{
|
||||
forward
|
||||
local ssize
|
||||
virtual at 0
|
||||
db sstring
|
||||
ssize = $
|
||||
end virtual
|
||||
dd ssize
|
||||
db sstring
|
||||
common
|
||||
dd -1
|
||||
}
|
||||
|
||||
|
||||
; strings
|
||||
macro sz name,[data] { ; from MFAR [mike.dld]
|
||||
common
|
||||
if used name
|
||||
label name
|
||||
end if
|
||||
forward
|
||||
if used name
|
||||
db data
|
||||
end if
|
||||
common
|
||||
if used name
|
||||
.size = $-name
|
||||
end if
|
||||
}
|
||||
|
||||
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
|
||||
common
|
||||
if used name
|
||||
label name
|
||||
end if
|
||||
forward
|
||||
if (used name)&(lang eq lng)
|
||||
db data
|
||||
end if
|
||||
common
|
||||
if used name
|
||||
.size = $-name
|
||||
end if
|
||||
}
|
||||
|
||||
|
||||
|
||||
; easy system call macro
|
||||
macro mpack dest, hsrc, lsrc
|
||||
{
|
||||
if (hsrc eqtype 0) & (lsrc eqtype 0)
|
||||
mov dest, (hsrc) shl 16 + lsrc
|
||||
else
|
||||
if (hsrc eqtype 0) & (~lsrc eqtype 0)
|
||||
mov dest, (hsrc) shl 16
|
||||
add dest, lsrc
|
||||
else
|
||||
mov dest, hsrc
|
||||
shl dest, 16
|
||||
add dest, lsrc
|
||||
end if
|
||||
end if
|
||||
}
|
||||
|
||||
macro __mov reg,a,b { ; mike.dld
|
||||
if (~a eq)&(~b eq)
|
||||
mpack reg,a,b
|
||||
else if (~a eq)&(b eq)
|
||||
mov reg,a
|
||||
end if
|
||||
}
|
||||
|
||||
macro mcall a,b,c,d,e,f { ; mike.dld
|
||||
__mov eax,a
|
||||
__mov ebx,b
|
||||
__mov ecx,c
|
||||
__mov edx,d
|
||||
__mov esi,e
|
||||
__mov edi,f
|
||||
int 0x40
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
; optimize the code for size
|
||||
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
|
||||
|
||||
macro add arg1,arg2
|
||||
{
|
||||
if (arg2 eqtype 0)
|
||||
if (arg2) = 1
|
||||
inc arg1
|
||||
else
|
||||
add arg1,arg2
|
||||
end if
|
||||
else
|
||||
add arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
macro sub arg1,arg2
|
||||
{
|
||||
if (arg2 eqtype 0)
|
||||
if (arg2) = 1
|
||||
dec arg1
|
||||
else
|
||||
sub arg1,arg2
|
||||
end if
|
||||
else
|
||||
sub arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
macro mov arg1,arg2
|
||||
{
|
||||
if (arg1 in __regs) & (arg2 eqtype 0)
|
||||
if (arg2) = 0
|
||||
xor arg1,arg1
|
||||
else if (arg2) = 1
|
||||
xor arg1,arg1
|
||||
inc arg1
|
||||
else if (arg2) = -1
|
||||
or arg1,-1
|
||||
else if (arg2) > -128 & (arg2) < 128
|
||||
push arg2
|
||||
pop arg1
|
||||
else
|
||||
mov arg1,arg2
|
||||
end if
|
||||
else
|
||||
mov arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
|
||||
macro struct name
|
||||
{
|
||||
virtual at 0
|
||||
name name
|
||||
sizeof.#name = $ - name
|
||||
end virtual
|
||||
}
|
||||
|
||||
; structures used in MeOS
|
||||
struc process_information
|
||||
{
|
||||
.cpu_usage dd ? ; +0
|
||||
.window_stack_position dw ? ; +4
|
||||
.window_stack_value dw ? ; +6
|
||||
.not_used1 dw ? ; +8
|
||||
.process_name rb 12 ; +10
|
||||
.memory_start dd ? ; +22
|
||||
.used_memory dd ? ; +26
|
||||
.PID dd ? ; +30
|
||||
.x_start dd ? ; +34
|
||||
.y_start dd ? ; +38
|
||||
.x_size dd ? ; +42
|
||||
.y_size dd ? ; +46
|
||||
.slot_state dw ? ; +50
|
||||
rb (1024-52)
|
||||
}
|
||||
struct process_information
|
||||
|
||||
struc system_colors
|
||||
{
|
||||
.frame dd ?
|
||||
.grab dd ?
|
||||
.grab_button dd ?
|
||||
.grab_button_text dd ?
|
||||
.grab_text dd ?
|
||||
.work dd ?
|
||||
.work_button dd ?
|
||||
.work_button_text dd ?
|
||||
.work_text dd ?
|
||||
.work_graph dd ?
|
||||
}
|
||||
struct system_colors
|
||||
|
||||
|
||||
; constants
|
||||
|
||||
; events
|
||||
EV_IDLE = 0
|
||||
EV_TIMER = 0
|
||||
EV_REDRAW = 1
|
||||
EV_KEY = 2
|
||||
EV_BUTTON = 3
|
||||
EV_EXIT = 4
|
||||
EV_BACKGROUND = 5
|
||||
EV_MOUSE = 6
|
||||
EV_IPC = 7
|
||||
EV_STACK = 8
|
||||
|
||||
; event mask bits for function 40
|
||||
EVM_REDRAW = 1b
|
||||
EVM_KEY = 10b
|
||||
EVM_BUTTON = 100b
|
||||
EVM_EXIT = 1000b
|
||||
EVM_BACKGROUND = 10000b
|
||||
EVM_MOUSE = 100000b
|
||||
EVM_IPC = 1000000b
|
||||
EVM_STACK = 10000000b
|
@ -1,405 +0,0 @@
|
||||
;
|
||||
; DESKTOP CONTEXT MENU
|
||||
; written by Ivan Poddubny
|
||||
;
|
||||
; €¢â®à - ˆ¢ <20>®¤¤ã¡ë©
|
||||
; e-mail: ivan-yar@bk.ru
|
||||
;
|
||||
; Compile with flat assembler
|
||||
;
|
||||
include 'lang.inc'
|
||||
include 'macros.inc'
|
||||
|
||||
meos_app_start
|
||||
code
|
||||
|
||||
mov eax,40 ; ãáâ ®¢¨¬ ¬ áªã ᮡë⨩
|
||||
mov ebx,100000b ; á ¨â¥à¥áã¥â ⮫쪮 ¬ëèì
|
||||
int 0x40
|
||||
|
||||
still: ; £« ¢ë© 横« ®á®¢®£® ¯à®æ¥áá
|
||||
|
||||
mov eax,10 ; ¦¤ñ¬ ᮡëâ¨ï
|
||||
int 0x40
|
||||
|
||||
mov eax,37 ; ª ª¨¥ ¦ âë ª¯®¯ª¨?
|
||||
mov ebx,2
|
||||
int 0x40
|
||||
|
||||
cmp eax,2 ; ¥á«¨ ¥ ¯à ¢ ï, ¢®§¢à â
|
||||
jne still
|
||||
|
||||
;---¯®¥å «¨!---
|
||||
|
||||
; mov eax,37 ; íâ® ¤«ï ®â« ¤ª¨ - ¥á«¨ ¬ëèì ¢ â®çª¥ (0;0), § ªà®¥¬áï
|
||||
; xor ebx,ebx
|
||||
; int 0x40
|
||||
; test eax,eax ; ªãàá®à ¢ â®çª¥ (0;0), â.¥. eax = 0
|
||||
; je exit
|
||||
|
||||
|
||||
mov eax,9 ; ¯®«ã稬 ç¨á«® ¯à®æ¥áᮢ ¢ á¨á⥬¥
|
||||
mov ebx,procinfo
|
||||
xor ecx,ecx
|
||||
int 0x40
|
||||
|
||||
inc eax ; ⥯¥àì ¢ eax ᮤ¥à¦¨âáï ç¨á«® ¯à®æ¥áᮢ + 1
|
||||
mov [processes],eax
|
||||
mov ecx,1
|
||||
|
||||
new_process:
|
||||
pushad
|
||||
mov eax,9 ; ¯®«ã稬 ¨ä®à¬ æ¨î ® ¯à®æ¥áá¥; ®¬¥à - ¢ ecx
|
||||
mov ebx,procinfo
|
||||
int 0x40
|
||||
mov eax,37 ; ª®®à¤¨ âë ªãàá®à
|
||||
xor ebx,ebx
|
||||
int 0x40
|
||||
mov ebx,eax ; eax = cursor_x
|
||||
shr eax,16 ; ebx = cursor_y
|
||||
and ebx,0xffff
|
||||
mov [curx1],eax ; curx1 = cursor_x
|
||||
mov [cury1],ebx ; cury1 = cursor_y
|
||||
; \begin{diamond}[18.09.2006]
|
||||
; ignore minimized windows
|
||||
test [procinfo.wnd_state], 2
|
||||
jnz ne_goden
|
||||
; \end{diamond}[18.09.2006]
|
||||
mov eax,[procinfo.x_start] ; eax = wnd_x_start
|
||||
mov ebx,[procinfo.y_start] ; ebx = wnd_y_start
|
||||
|
||||
mov ecx,[procinfo.x_size]
|
||||
add ecx,eax ; ecx = wnd_x_end
|
||||
mov edx,[procinfo.y_size]
|
||||
add edx,ebx ; ecx = wnd_y_end
|
||||
|
||||
cmp eax,[curx1] ; wnd_x_start > cursor_x => ªãàá®à «¥¢¥¥ ®ª
|
||||
jg ne_goden
|
||||
cmp ecx,[curx1] ; wnd_x_end < cursor_x => ªãàá®à ¯à ¢¥¥ ®ª
|
||||
jl ne_goden
|
||||
cmp ebx,[cury1] ; wnd_y_start > cursor_y => ªãàá®à ¢ëè¥ ®ª
|
||||
jg ne_goden
|
||||
cmp edx,[cury1] ; wnd_y_end < cursor_y => ªãàá®à ¨¦¥ ®ª
|
||||
jl ne_goden
|
||||
|
||||
goden: ; ª«¨ª ¡ë« ¢ãâਠª ª®£®-â® ®ª , ¯®í⮬㠨祣® ¥ ¤¥« ¥¬
|
||||
popad
|
||||
jmp still
|
||||
|
||||
ne_goden: ; ª«¨ª ¡ë« á à㦨 à áᬠâਢ ¥¬®£® ®ª , ¯®í⮬ã
|
||||
popad
|
||||
inc ecx
|
||||
cmp ecx,[processes]
|
||||
jl new_process ; «¨¡® ᬮਬ á«¥¤ãî饥 ®ª®, «¨¡® § ¯ã᪠¥¬ ¬¥î
|
||||
|
||||
|
||||
@@: ; ¯®¤®¦¤ñ¬, ¯®ª ¯®«ì§®¢ â¥«ì ¥ ®â¯ãá⨫ ¯à ¢ãî ª®¯ªã ¬ëè¨
|
||||
mov eax,37
|
||||
mov ebx,2 ; äãªæ¨ï 37-2:
|
||||
int 0x40 ; ¦ âë «¨ ª®¯ª¨ ¬ëè¨?
|
||||
cmp eax,ebx ; ¥á«¨ ®â¯ãá⨫, (eax != 2)
|
||||
jnz @f ; ¨¤ñ¬ ¢ ç «® £« ¢®£® 横«
|
||||
|
||||
mov eax,5 ; ¨ ç¥
|
||||
mov ebx,2 ; ¯®¤®¦¤ñ¬ 2 ¬á
|
||||
int 0x40
|
||||
|
||||
jmp @b ; ¨ ¯à®¢¥à¨¬ ¬ëèì ®¯ïâì
|
||||
@@:
|
||||
|
||||
; ¥á«¨ 㦥 ¡ë«® ®âªàëâ® ¬¥î, 㦮 ¯®¤®¦¤ âì, ¯®ª ®® § ªà®¥âáï:
|
||||
@@:
|
||||
cmp [menu_opened],0
|
||||
je @f
|
||||
mov eax,5
|
||||
mov ebx,3 ; ¦¤ñ¬ 3 ¬á
|
||||
int 0x40
|
||||
jmp @b
|
||||
@@:
|
||||
|
||||
mov eax,51 ; ⥯¥àì ¬®¦® ᬥ«® § ¯ã᪠âì ¯à®æ¥áá (¯®â®ª) ¬¥î
|
||||
mov ebx,1 ; ᮧ¤ ñ¬ ¯®â®ª (thread)
|
||||
mov ecx,start_wnd ; â®çª ¢å®¤ ¯®â®ª
|
||||
mov edx,stack_wnd ; ¢¥àè¨ áâíª ¤«ï ¯®â®ª
|
||||
int 0x40
|
||||
|
||||
jmp still
|
||||
|
||||
|
||||
|
||||
exit_menu: ; ¥á«¨ ¢ë室¨¬ ¨§ ¬¥î, ¤® § ¯¨á âì ¢ [menu_opened] 0
|
||||
mov [menu_opened],0
|
||||
exit: ; áî¤ ¬ë ¨¤ñ¬, ª®£¤ ¢ë室¨¬ ¨§ ®á®¢®£® ¯à®æ¥áá
|
||||
or eax,-1 ; eax = -1
|
||||
int 0x40
|
||||
|
||||
|
||||
|
||||
|
||||
; §¤¥áì áâ àâã¥â ¯à®æ¥áá ¬¥î
|
||||
start_wnd:
|
||||
mov [menu_opened],1
|
||||
mov eax,40 ; ãáâ ®¢¨¬ ¬ áªã ¦¥« ¥¬ëå ᮡë⨩ ¤«ï í⮣® ¯à®æ¥áá
|
||||
mov ebx,100101b ; ¬¥î + ª®¯ª¨ + ¯¥à¥à¨á®¢ª
|
||||
int 0x40
|
||||
|
||||
red:
|
||||
call draw_window
|
||||
|
||||
still2: ; £« ¢ë© 横« ¯à®æ¥áá ¬¥î
|
||||
|
||||
mov eax,10 ; ¦¤ñ¬ ᮡëâ¨ï
|
||||
int 0x40
|
||||
|
||||
cmp eax,1 ; ¯¥à¥à¨á®¢ª ?
|
||||
je red
|
||||
cmp eax,3 ; ª®¯ª ?
|
||||
je button
|
||||
cmp eax,6 ; ¬ëèì?
|
||||
je mouse
|
||||
|
||||
jmp still2 ; ¢¥àñ¬áï ¢ ç «® £« ¢®£® 横«
|
||||
|
||||
|
||||
; Ž<><C5BD>€<EFBFBD>Ž’—ˆŠ Œ›˜ˆ
|
||||
mouse: ; ª®£¤ ¯®«ì§®¢ â¥«ì ¦¬ñâ ª®¯ªã ¬ëè¨, § ªà®¥¬áï
|
||||
mov eax,37
|
||||
mov ebx,2 ; ª ª¨¥ ª®¯ª¨ ¦ âë?
|
||||
int 0x40
|
||||
test eax,eax ; ¨ª ª¨¥? - ⮣¤ ¯à¥ªà á®! ¢¥àñ¬áï ¢ £« ë© æ¨ª«
|
||||
jz still2
|
||||
jmp exit_menu ; ¥á«¨ ¢áñ-â ª¨ ¦ âë - § ªà®¥¬ ®ª®
|
||||
|
||||
|
||||
; <20>€†€’€ Š<>Ž<EFBFBD>Š€
|
||||
button:
|
||||
mov eax,17 ; ¯®«ãç¨âì ¨¤¥â¨ä¨ª â®à ¦ ⮩ ª®¯ª¨
|
||||
int 0x40
|
||||
|
||||
sub ah,10 ; áà ¢¨¢ ¥¬ á 10
|
||||
jl nofuncbtns ; ¥á«¨ ¬¥ìè¥ - § ªàë¢ ¥¬ ¬¥î
|
||||
|
||||
movzx ebx,ah ; ¯®«ã稫¨ ®¬¥à ¯à®£à ¬¬ë ¢ ᯨ᪥ ¢ ebx
|
||||
mov esi, [startapps + ebx*4]
|
||||
mov edi, start_info.path
|
||||
cld
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
test al, al
|
||||
jnz @b
|
||||
mcall 70, start_info
|
||||
|
||||
; mov eax,5 ; ¯®¤®¦¤ñ¬, ¯®ª ¯à®£à ¬¬ § ¯ãáâ¨âìáï
|
||||
; mov ebx,1 ; â® ¥ñ ®ª® ¥ ¡ã¤¥â ®âà¨á®¢ ® (¡ £ ¢ ï¤à¥???)
|
||||
; int 0x40 ; à ᪮¬¬¥â¨àã©â¥ í⨠áâப¨, ¥á«¨ ã ¢ á ¯à®¡«¥¬ë
|
||||
; á ®âà¨á®¢ª®©
|
||||
|
||||
nofuncbtns: ; § ªàë¢ ¥¬ ¬¥î
|
||||
jmp exit_menu
|
||||
|
||||
|
||||
|
||||
_BTNS_ = 7 ; ª®«¨ç¥á⢮ ª®¯®ª ("¯ãªâ®¢ ¬¥î")
|
||||
|
||||
if lang eq ru
|
||||
font = 0x00000000
|
||||
string_length = 20 ; ¤«¨ áâப¨
|
||||
wnd_x_size = 133 ; è¨à¨ ®ª
|
||||
header_pos = 36 shl 16 + 7
|
||||
else
|
||||
font = 0x10000000
|
||||
string_length = 12 ; ¤«¨ áâப¨
|
||||
wnd_x_size = 105 ; è¨à¨ ®ª
|
||||
header_pos = 23 shl 16 + 7
|
||||
end if
|
||||
|
||||
;*******************************
|
||||
;******** <20>ˆ‘“…Œ ŽŠ<C5BD>Ž ********
|
||||
;*******************************
|
||||
|
||||
draw_window:
|
||||
|
||||
mov eax,12 ; ç¨ ¥¬ "à¨á®¢ âì"
|
||||
mov ebx,1
|
||||
int 0x40
|
||||
|
||||
mov eax,[curx1] ; ⥪ã騥 ª®®à¤¨ âë ªãàá®à
|
||||
mov [curx],eax ; § ¯¨è¥¬ ¢ ª®®à¤¨ âë ®ª
|
||||
mov eax,[cury1]
|
||||
mov [cury],eax
|
||||
|
||||
; ⥯¥àì ¡ã¤¥¬ áç¨â âì ª®®à¤¨ âë ®ª , çâ®¡ë ®® § ªà © íªà ¥ ¢ë«¥§«®
|
||||
mov eax,14 ; ¯®«ã稬 à §¬¥à íªà
|
||||
int 0x40
|
||||
mov ebx,eax
|
||||
shr eax,16 ; ¢ eax - x_screen
|
||||
and ebx,0xffff ; ¢ ebx - y_screen
|
||||
add eax,-wnd_x_size ; eax = [x_screen - è¨à¨ ®ª ]
|
||||
add ebx,-_BTNS_*15-21 ; ebx = [y_screen - ¢ëá®â ®ª ]
|
||||
|
||||
cmp eax,[curx]
|
||||
jg .okx ; ¥á«¨ ®ª® ᫨誮¬ ¡«¨§ª® ª ¯à ¢®¬ã ªà î,
|
||||
add [curx],-wnd_x_size ; ᤢ¨¥¬ ¥£® ¢«¥¢® 100
|
||||
.okx:
|
||||
|
||||
cmp ebx, [cury]
|
||||
jg .oky ; ¯® ¢¥à⨪ «¨ â®ç® â ª¦¥
|
||||
add [cury], -_BTNS_*15-21
|
||||
.oky:
|
||||
|
||||
mov eax, 48 ; ¯®«ãç¨âì á¨áâ¥¬ë¥ æ¢¥â
|
||||
mov ebx, 3
|
||||
mov ecx, sc ; ¤à¥á áâàãªâãàë
|
||||
mov edx, sizeof.system_colors ; ¨ ¥¥ à §¬¥à
|
||||
int 0x40
|
||||
|
||||
xor eax, eax ; äãªæ¨ï 0 - ᮧ¤ âì ®ª®
|
||||
mov ebx, [curx] ; ebx = [ª®®à¤¨ â ¯® x] shl 16 + [è¨à¨ ]
|
||||
shl ebx, 16
|
||||
add ebx, wnd_x_size
|
||||
mov ecx, [cury] ; ecx = [ª®®à¤¨ â ¯® y] shl 16 + [¢ëá®â ]
|
||||
shl ecx, 16
|
||||
add ecx, _BTNS_*15+21
|
||||
mov edx, [sc.work] ; 梥â à ¡®ç¥© ®¡« áâ¨
|
||||
mov esi, [sc.grab] ; 梥⠧ £®«®¢ª
|
||||
or esi, 0x81000000
|
||||
mov edi, [sc.frame] ; 梥â à ¬ª¨
|
||||
int 0x40
|
||||
|
||||
mov eax, 4 ; § £®«®¢®ª
|
||||
mov ebx, header_pos ; [x] shl 16 + [y]
|
||||
mov ecx, [sc.grab_text]; èà¨äâ ¨ 梥â (á¥àë©)
|
||||
or ecx, 0x10000000
|
||||
; add ecx, -0x333333
|
||||
push ecx
|
||||
push ecx
|
||||
xor edx,edx
|
||||
.dec_color:
|
||||
sub byte [esp+edx], 0x33
|
||||
jae @f
|
||||
mov byte [esp+edx], 0
|
||||
@@:
|
||||
inc edx
|
||||
jnp .dec_color
|
||||
pop ecx
|
||||
mov edx, header ; ¤à¥á § £®«®¢ª
|
||||
mov esi, header.size ; ¤«¨ § £®«®¢ª ("M E N U")
|
||||
int 0x40
|
||||
pop ecx
|
||||
add ebx, 1 shl 16 ; ᤢ¨¥¬ ¢¯à ¢® 1
|
||||
int 0x40
|
||||
|
||||
mov ebx, 1*65536+wnd_x_size-2 ; ç¨ ¥¬ ¤¥« âì ª®¯ª¨
|
||||
mov ecx, 20*65536+15
|
||||
mov edx, 10 or 0x40000000 ; ¡¨â 30 ãáâ ®¢«¥ => ª®¯ª ¥ à¨áã¥âáï
|
||||
|
||||
mov edi,_BTNS_ ; ª®«¨ç¥á⢮ ª®¯®ª (áçñâ稪)
|
||||
|
||||
newbtn: ; ç «® 横«
|
||||
mov eax,8 ; ᮧ¤ ñ¬ ª®¯ªã
|
||||
int 0x40
|
||||
|
||||
; ¯¨è¥¬ ⥪áâ ª®¯ª¥
|
||||
pushad ; á¯ á ¥¬ ॣ¨áâàë
|
||||
shr ecx, 16
|
||||
and ebx, 0xffff0000
|
||||
add ebx, ecx ; ebx = [x] shl 16 + [y];
|
||||
add ebx, 10*65536+4 ; ebx += ᬥ饨¥ ®â®á¨â¥«ì® ªà ï ª®¯ª¨;
|
||||
mov ecx, [sc.work_text] ; èà¨äâ ¨ 梥â
|
||||
or ecx, font
|
||||
add edx, -10 ; edx = ®¬¥à ª®¯ª¨;
|
||||
imul edx, string_length ; edx *= ¤«¨ áâப¨;
|
||||
add edx, text ; edx += text; ⥯¥àì ¢ edx ¤à¥á áâப¨
|
||||
mov esi, string_length ; ¢ esi - ¤«¨ áâப¨
|
||||
mov eax, 4 ; äãªæ¨ï 4 - ¢ë¢®¤ ⥪áâ
|
||||
int 0x40
|
||||
popad
|
||||
|
||||
inc edx ; ®¬¥à ª®¯ª¨++;
|
||||
add ecx,15*65536 ; 㢥«¨ç¨¬ ᬥ饨¥ ¯® y
|
||||
dec edi ; 㬥ì訬 áçñâ稪
|
||||
jnz newbtn ; ¥á«¨ ¥ ®«ì, ¯®¢â®à¨¬ ¢áñ ¥éñ à §
|
||||
|
||||
mov eax,12 ; § ª®ç¨«¨ "à¨á®¢ âì"
|
||||
mov ebx,2
|
||||
int 0x40
|
||||
|
||||
ret ; ¢®§¢à â
|
||||
|
||||
|
||||
|
||||
; „€<E2809E><E282AC>›… <20><>Žƒ<C5BD>€ŒŒ›
|
||||
DATA
|
||||
|
||||
macro strtbl name, [string]
|
||||
{
|
||||
common
|
||||
label name dword
|
||||
forward
|
||||
local str
|
||||
dd str
|
||||
forward
|
||||
str db string
|
||||
}
|
||||
|
||||
strtbl startapps ,\
|
||||
<"/HD0/1/KOLIBRI/BIN/PIC4",0> ,\
|
||||
<"/HD0/1/KOLIBRI/BIN/SKINSEL",0> ,\
|
||||
<"/HD0/1/KOLIBRI/BIN/DESKTOP",0> ,\
|
||||
<"/HD0/1/KOLIBRI/BIN/ICON",0> ,\
|
||||
<"/HD0/1/KOLIBRI/BIN/SETUP",0> ,\
|
||||
<"/HD0/1/KOLIBRI/BIN/VRR",0> ,\
|
||||
<"/HD0/1/KOLIBRI/BIN/CPU",0>
|
||||
|
||||
sz header, "KolibriOS"
|
||||
|
||||
lsz text,\
|
||||
en, 'Background ',\
|
||||
en, 'Change skin ',\
|
||||
en, 'Desktop ',\
|
||||
en, 'Icon manager',\
|
||||
en, 'Device setup',\
|
||||
en, 'VRR ',\
|
||||
en, 'Processes ',\
|
||||
\
|
||||
ru, 'ƒ¥¥à â®à ®¡®¥¢ ',\
|
||||
ru, '‘¬¥ ᪨ ',\
|
||||
ru, '<27> áâனª ®ª® ',\
|
||||
ru, '“¯à ¢«¥¨¥ ¨ª®ª ¬¨ ',\
|
||||
ru, '<27> áâனª ãáâனá⢠',\
|
||||
ru, '<27> áâனª ¬®¨â®à ',\
|
||||
ru, '<27>à®æ¥ááë '
|
||||
|
||||
start_info:
|
||||
.mode dd 7
|
||||
dd 0
|
||||
.params dd 0
|
||||
dd 0
|
||||
dd 0
|
||||
db 0
|
||||
dd start_info.path
|
||||
|
||||
; <20>…ˆ<E280A6>ˆ–ˆ€‹ˆ‡ˆ<E280A1>Ž‚€<E2809A><E282AC>›… „€<E2809E><E282AC>›…
|
||||
UDATA
|
||||
processes dd ? ; ª®«¨ç¥á⢮ ¯à®æ¥áᮢ ¢ á¨á⥬¥
|
||||
curx1 dd ? ; ª®®à¤¨ âë ªãàá®à
|
||||
cury1 dd ?
|
||||
curx dd ? ; ª®®à¤¨ âë ®ª ¬¥î
|
||||
cury dd ?
|
||||
|
||||
menu_opened db ? ; ®âªàëâ® ¬¥î ¨«¨ ¥â? (1-¤ , 0-¥â)
|
||||
|
||||
align 4
|
||||
start_info.path rb 256
|
||||
|
||||
sc system_colors ; á¨áâ¥¬ë¥ æ¢¥â
|
||||
procinfo process_information ; ¨ä®à¬ æ¨ï ® ¯à®æ¥áá¥
|
||||
|
||||
rb 1024 ; áâíª ¤«ï ®ª ¬¥î - å¢ â¨â ¨ 1 Š¡
|
||||
align 32
|
||||
stack_wnd:
|
||||
|
||||
|
||||
MEOS_APP_END
|
||||
; ŠŽ<C5A0>…– <20><>Žƒ<C5BD>€ŒŒ›
|
@ -1,5 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix en >lang.inc
|
||||
@fasm @rb.asm @rb
|
||||
@erase lang.inc
|
||||
@pause
|
@ -1,5 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix ru >lang.inc
|
||||
@fasm @rb.asm @rb
|
||||
@erase lang.inc
|
||||
@pause
|
@ -1,269 +0,0 @@
|
||||
; new application structure
|
||||
macro meos_app_start
|
||||
{
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
db 'MENUET01'
|
||||
dd 0x01
|
||||
dd __start
|
||||
dd __end
|
||||
dd __memory
|
||||
dd __stack
|
||||
|
||||
if used __params & ~defined __params
|
||||
dd __params
|
||||
else
|
||||
dd 0x0
|
||||
end if
|
||||
|
||||
dd 0x0
|
||||
}
|
||||
MEOS_APP_START fix meos_app_start
|
||||
|
||||
macro code
|
||||
{
|
||||
__start:
|
||||
}
|
||||
CODE fix code
|
||||
|
||||
macro data
|
||||
{
|
||||
__data:
|
||||
}
|
||||
DATA fix data
|
||||
|
||||
macro udata
|
||||
{
|
||||
if used __params & ~defined __params
|
||||
__params:
|
||||
db 0
|
||||
__end:
|
||||
rb 255
|
||||
else
|
||||
__end:
|
||||
end if
|
||||
__udata:
|
||||
}
|
||||
UDATA fix udata
|
||||
|
||||
macro meos_app_end
|
||||
{
|
||||
align 32
|
||||
rb 2048
|
||||
__stack:
|
||||
__memory:
|
||||
}
|
||||
MEOS_APP_END fix meos_app_end
|
||||
|
||||
|
||||
; macro for defining multiline text data
|
||||
struc mstr [sstring]
|
||||
{
|
||||
forward
|
||||
local ssize
|
||||
virtual at 0
|
||||
db sstring
|
||||
ssize = $
|
||||
end virtual
|
||||
dd ssize
|
||||
db sstring
|
||||
common
|
||||
dd -1
|
||||
}
|
||||
|
||||
|
||||
; strings
|
||||
macro sz name,[data] { ; from MFAR [mike.dld]
|
||||
common
|
||||
if used name
|
||||
label name
|
||||
end if
|
||||
forward
|
||||
if used name
|
||||
db data
|
||||
end if
|
||||
common
|
||||
if used name
|
||||
.size = $-name
|
||||
end if
|
||||
}
|
||||
|
||||
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
|
||||
common
|
||||
if used name
|
||||
label name
|
||||
end if
|
||||
forward
|
||||
if (used name)&(lang eq lng)
|
||||
db data
|
||||
end if
|
||||
common
|
||||
if used name
|
||||
.size = $-name
|
||||
end if
|
||||
}
|
||||
|
||||
|
||||
|
||||
; easy system call macro
|
||||
macro mpack dest, hsrc, lsrc
|
||||
{
|
||||
if (hsrc eqtype 0) & (lsrc eqtype 0)
|
||||
mov dest, (hsrc) shl 16 + lsrc
|
||||
else
|
||||
if (hsrc eqtype 0) & (~lsrc eqtype 0)
|
||||
mov dest, (hsrc) shl 16
|
||||
add dest, lsrc
|
||||
else
|
||||
mov dest, hsrc
|
||||
shl dest, 16
|
||||
add dest, lsrc
|
||||
end if
|
||||
end if
|
||||
}
|
||||
|
||||
macro __mov reg,a,b { ; mike.dld
|
||||
if (~a eq)&(~b eq)
|
||||
mpack reg,a,b
|
||||
else if (~a eq)&(b eq)
|
||||
mov reg,a
|
||||
end if
|
||||
}
|
||||
|
||||
macro mcall a,b,c,d,e,f { ; mike.dld
|
||||
__mov eax,a
|
||||
__mov ebx,b
|
||||
__mov ecx,c
|
||||
__mov edx,d
|
||||
__mov esi,e
|
||||
__mov edi,f
|
||||
int 0x40
|
||||
}
|
||||
|
||||
|
||||
|
||||
; optimize the code for size
|
||||
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
|
||||
|
||||
macro add arg1,arg2
|
||||
{
|
||||
if (arg2 eqtype 0)
|
||||
if (arg2) = 1
|
||||
inc arg1
|
||||
else
|
||||
add arg1,arg2
|
||||
end if
|
||||
else
|
||||
add arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
macro sub arg1,arg2
|
||||
{
|
||||
if (arg2 eqtype 0)
|
||||
if (arg2) = 1
|
||||
dec arg1
|
||||
else
|
||||
sub arg1,arg2
|
||||
end if
|
||||
else
|
||||
sub arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
macro mov arg1,arg2
|
||||
{
|
||||
if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
|
||||
if (arg2) = 0
|
||||
xor arg1,arg1
|
||||
else if (arg2) = 1
|
||||
xor arg1,arg1
|
||||
inc arg1
|
||||
else if (arg2) = -1
|
||||
or arg1,-1
|
||||
else if (arg2) > -128 & (arg2) < 128
|
||||
push arg2
|
||||
pop arg1
|
||||
else
|
||||
mov arg1,arg2
|
||||
end if
|
||||
else
|
||||
mov arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
|
||||
macro struct name
|
||||
{
|
||||
virtual at 0
|
||||
name name
|
||||
sizeof.#name = $ - name
|
||||
end virtual
|
||||
}
|
||||
|
||||
; structures used in MeOS
|
||||
struc process_information
|
||||
{
|
||||
.cpu_usage dd ? ; +0
|
||||
.window_stack_position dw ? ; +4
|
||||
.window_stack_value dw ? ; +6
|
||||
.not_used1 dw ? ; +8
|
||||
.process_name rb 12 ; +10
|
||||
.memory_start dd ? ; +22
|
||||
.used_memory dd ? ; +26
|
||||
.PID dd ? ; +30
|
||||
.x_start dd ? ; +34
|
||||
.y_start dd ? ; +38
|
||||
.x_size dd ? ; +42
|
||||
.y_size dd ? ; +46
|
||||
.slot_state dw ? ; +50
|
||||
dw ? ; +52 - reserved
|
||||
.client_left dd ? ; +54
|
||||
.client_top dd ? ; +58
|
||||
.client_width dd ? ; +62
|
||||
.client_height dd ? ; +66
|
||||
.wnd_state db ? ; +70
|
||||
rb (1024-71)
|
||||
}
|
||||
struct process_information
|
||||
|
||||
struc system_colors
|
||||
{
|
||||
.frame dd ?
|
||||
.grab dd ?
|
||||
.grab_button dd ?
|
||||
.grab_button_text dd ?
|
||||
.grab_text dd ?
|
||||
.work dd ?
|
||||
.work_button dd ?
|
||||
.work_button_text dd ?
|
||||
.work_text dd ?
|
||||
.work_graph dd ?
|
||||
}
|
||||
struct system_colors
|
||||
|
||||
|
||||
; constants
|
||||
|
||||
; events
|
||||
EV_IDLE = 0
|
||||
EV_TIMER = 0
|
||||
EV_REDRAW = 1
|
||||
EV_KEY = 2
|
||||
EV_BUTTON = 3
|
||||
EV_EXIT = 4
|
||||
EV_BACKGROUND = 5
|
||||
EV_MOUSE = 6
|
||||
EV_IPC = 7
|
||||
EV_STACK = 8
|
||||
|
||||
; event mask bits for function 40
|
||||
EVM_REDRAW = 1b
|
||||
EVM_KEY = 10b
|
||||
EVM_BUTTON = 100b
|
||||
EVM_EXIT = 1000b
|
||||
EVM_BACKGROUND = 10000b
|
||||
EVM_MOUSE = 100000b
|
||||
EVM_IPC = 1000000b
|
||||
EVM_STACK = 10000000b
|
Binary file not shown.
@ -1,3 +0,0 @@
|
||||
echo lang fix en > lang.inc
|
||||
fasm setup.asm setup
|
||||
pause
|
@ -1,269 +0,0 @@
|
||||
; new application structure
|
||||
macro meos_app_start
|
||||
{
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
db 'MENUET01'
|
||||
dd 0x01
|
||||
dd __start
|
||||
dd __end
|
||||
dd __memory
|
||||
dd __stack
|
||||
|
||||
if used __params & ~defined __params
|
||||
dd __params
|
||||
else
|
||||
dd 0x0
|
||||
end if
|
||||
|
||||
dd 0x0
|
||||
}
|
||||
MEOS_APP_START fix meos_app_start
|
||||
|
||||
macro code
|
||||
{
|
||||
__start:
|
||||
}
|
||||
CODE fix code
|
||||
|
||||
macro data
|
||||
{
|
||||
__data:
|
||||
}
|
||||
DATA fix data
|
||||
|
||||
macro udata
|
||||
{
|
||||
if used __params & ~defined __params
|
||||
__params:
|
||||
db 0
|
||||
__end:
|
||||
rb 255
|
||||
else
|
||||
__end:
|
||||
end if
|
||||
__udata:
|
||||
}
|
||||
UDATA fix udata
|
||||
|
||||
macro meos_app_end
|
||||
{
|
||||
align 32
|
||||
rb 2048
|
||||
__stack:
|
||||
__memory:
|
||||
}
|
||||
MEOS_APP_END fix meos_app_end
|
||||
|
||||
|
||||
; macro for defining multiline text data
|
||||
struc mstr [sstring]
|
||||
{
|
||||
forward
|
||||
local ssize
|
||||
virtual at 0
|
||||
db sstring
|
||||
ssize = $
|
||||
end virtual
|
||||
dd ssize
|
||||
db sstring
|
||||
common
|
||||
dd -1
|
||||
}
|
||||
|
||||
|
||||
; strings
|
||||
macro sz name,[data] { ; from MFAR [mike.dld]
|
||||
common
|
||||
if used name
|
||||
label name
|
||||
end if
|
||||
forward
|
||||
if used name
|
||||
db data
|
||||
end if
|
||||
common
|
||||
if used name
|
||||
.size = $-name
|
||||
end if
|
||||
}
|
||||
|
||||
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
|
||||
common
|
||||
if used name
|
||||
label name
|
||||
end if
|
||||
forward
|
||||
if (used name)&(lang eq lng)
|
||||
db data
|
||||
end if
|
||||
common
|
||||
if used name
|
||||
.size = $-name
|
||||
end if
|
||||
}
|
||||
|
||||
|
||||
|
||||
; easy system call macro
|
||||
macro mpack dest, hsrc, lsrc
|
||||
{
|
||||
if (hsrc eqtype 0) & (lsrc eqtype 0)
|
||||
mov dest, (hsrc) shl 16 + lsrc
|
||||
else
|
||||
if (hsrc eqtype 0) & (~lsrc eqtype 0)
|
||||
mov dest, (hsrc) shl 16
|
||||
add dest, lsrc
|
||||
else
|
||||
mov dest, hsrc
|
||||
shl dest, 16
|
||||
add dest, lsrc
|
||||
end if
|
||||
end if
|
||||
}
|
||||
|
||||
macro __mov reg,a,b { ; mike.dld
|
||||
if (~a eq)&(~b eq)
|
||||
mpack reg,a,b
|
||||
else if (~a eq)&(b eq)
|
||||
mov reg,a
|
||||
end if
|
||||
}
|
||||
|
||||
macro mcall a,b,c,d,e,f { ; mike.dld
|
||||
__mov eax,a
|
||||
__mov ebx,b
|
||||
__mov ecx,c
|
||||
__mov edx,d
|
||||
__mov esi,e
|
||||
__mov edi,f
|
||||
int 0x40
|
||||
}
|
||||
|
||||
|
||||
|
||||
; optimize the code for size
|
||||
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
|
||||
|
||||
macro add arg1,arg2
|
||||
{
|
||||
if (arg2 eqtype 0)
|
||||
if (arg2) = 1
|
||||
inc arg1
|
||||
else
|
||||
add arg1,arg2
|
||||
end if
|
||||
else
|
||||
add arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
macro sub arg1,arg2
|
||||
{
|
||||
if (arg2 eqtype 0)
|
||||
if (arg2) = 1
|
||||
dec arg1
|
||||
else
|
||||
sub arg1,arg2
|
||||
end if
|
||||
else
|
||||
sub arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
macro mov arg1,arg2
|
||||
{
|
||||
if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
|
||||
if (arg2) = 0
|
||||
xor arg1,arg1
|
||||
else if (arg2) = 1
|
||||
xor arg1,arg1
|
||||
inc arg1
|
||||
else if (arg2) = -1
|
||||
or arg1,-1
|
||||
else if (arg2) > -128 & (arg2) < 128
|
||||
push arg2
|
||||
pop arg1
|
||||
else
|
||||
mov arg1,arg2
|
||||
end if
|
||||
else
|
||||
mov arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
|
||||
macro struct name
|
||||
{
|
||||
virtual at 0
|
||||
name name
|
||||
sizeof.#name = $ - name
|
||||
end virtual
|
||||
}
|
||||
|
||||
; structures used in MeOS
|
||||
struc process_information
|
||||
{
|
||||
.cpu_usage dd ? ; +0
|
||||
.window_stack_position dw ? ; +4
|
||||
.window_stack_value dw ? ; +6
|
||||
.not_used1 dw ? ; +8
|
||||
.process_name rb 12 ; +10
|
||||
.memory_start dd ? ; +22
|
||||
.used_memory dd ? ; +26
|
||||
.PID dd ? ; +30
|
||||
.x_start dd ? ; +34
|
||||
.y_start dd ? ; +38
|
||||
.x_size dd ? ; +42
|
||||
.y_size dd ? ; +46
|
||||
.slot_state dw ? ; +50
|
||||
dw ? ; +52 - reserved
|
||||
.client_left dd ? ; +54
|
||||
.client_top dd ? ; +58
|
||||
.client_width dd ? ; +62
|
||||
.client_height dd ? ; +66
|
||||
.wnd_state db ? ; +70
|
||||
rb (1024-71)
|
||||
}
|
||||
struct process_information
|
||||
|
||||
struc system_colors
|
||||
{
|
||||
.frame dd ?
|
||||
.grab dd ?
|
||||
.grab_button dd ?
|
||||
.grab_button_text dd ?
|
||||
.grab_text dd ?
|
||||
.work dd ?
|
||||
.work_button dd ?
|
||||
.work_button_text dd ?
|
||||
.work_text dd ?
|
||||
.work_graph dd ?
|
||||
}
|
||||
struct system_colors
|
||||
|
||||
|
||||
; constants
|
||||
|
||||
; events
|
||||
EV_IDLE = 0
|
||||
EV_TIMER = 0
|
||||
EV_REDRAW = 1
|
||||
EV_KEY = 2
|
||||
EV_BUTTON = 3
|
||||
EV_EXIT = 4
|
||||
EV_BACKGROUND = 5
|
||||
EV_MOUSE = 6
|
||||
EV_IPC = 7
|
||||
EV_STACK = 8
|
||||
|
||||
; event mask bits for function 40
|
||||
EVM_REDRAW = 1b
|
||||
EVM_KEY = 10b
|
||||
EVM_BUTTON = 100b
|
||||
EVM_EXIT = 1000b
|
||||
EVM_BACKGROUND = 10000b
|
||||
EVM_MOUSE = 100000b
|
||||
EVM_IPC = 1000000b
|
||||
EVM_STACK = 10000000b
|
File diff suppressed because it is too large
Load Diff
@ -1,2 +0,0 @@
|
||||
fasm vrr_m.asm vrr_m
|
||||
pause
|
@ -1,269 +0,0 @@
|
||||
; new application structure
|
||||
macro meos_app_start
|
||||
{
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
db 'MENUET01'
|
||||
dd 0x01
|
||||
dd __start
|
||||
dd __end
|
||||
dd __memory
|
||||
dd __stack
|
||||
|
||||
if used __params & ~defined __params
|
||||
dd __params
|
||||
else
|
||||
dd 0x0
|
||||
end if
|
||||
|
||||
dd 0x0
|
||||
}
|
||||
MEOS_APP_START fix meos_app_start
|
||||
|
||||
macro code
|
||||
{
|
||||
__start:
|
||||
}
|
||||
CODE fix code
|
||||
|
||||
macro data
|
||||
{
|
||||
__data:
|
||||
}
|
||||
DATA fix data
|
||||
|
||||
macro udata
|
||||
{
|
||||
if used __params & ~defined __params
|
||||
__params:
|
||||
db 0
|
||||
__end:
|
||||
rb 255
|
||||
else
|
||||
__end:
|
||||
end if
|
||||
__udata:
|
||||
}
|
||||
UDATA fix udata
|
||||
|
||||
macro meos_app_end
|
||||
{
|
||||
align 32
|
||||
rb 2048
|
||||
__stack:
|
||||
__memory:
|
||||
}
|
||||
MEOS_APP_END fix meos_app_end
|
||||
|
||||
|
||||
; macro for defining multiline text data
|
||||
struc mstr [sstring]
|
||||
{
|
||||
forward
|
||||
local ssize
|
||||
virtual at 0
|
||||
db sstring
|
||||
ssize = $
|
||||
end virtual
|
||||
dd ssize
|
||||
db sstring
|
||||
common
|
||||
dd -1
|
||||
}
|
||||
|
||||
|
||||
; strings
|
||||
macro sz name,[data] { ; from MFAR [mike.dld]
|
||||
common
|
||||
if used name
|
||||
label name
|
||||
end if
|
||||
forward
|
||||
if used name
|
||||
db data
|
||||
end if
|
||||
common
|
||||
if used name
|
||||
.size = $-name
|
||||
end if
|
||||
}
|
||||
|
||||
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
|
||||
common
|
||||
if used name
|
||||
label name
|
||||
end if
|
||||
forward
|
||||
if (used name)&(lang eq lng)
|
||||
db data
|
||||
end if
|
||||
common
|
||||
if used name
|
||||
.size = $-name
|
||||
end if
|
||||
}
|
||||
|
||||
|
||||
|
||||
; easy system call macro
|
||||
macro mpack dest, hsrc, lsrc
|
||||
{
|
||||
if (hsrc eqtype 0) & (lsrc eqtype 0)
|
||||
mov dest, (hsrc) shl 16 + lsrc
|
||||
else
|
||||
if (hsrc eqtype 0) & (~lsrc eqtype 0)
|
||||
mov dest, (hsrc) shl 16
|
||||
add dest, lsrc
|
||||
else
|
||||
mov dest, hsrc
|
||||
shl dest, 16
|
||||
add dest, lsrc
|
||||
end if
|
||||
end if
|
||||
}
|
||||
|
||||
macro __mov reg,a,b { ; mike.dld
|
||||
if (~a eq)&(~b eq)
|
||||
mpack reg,a,b
|
||||
else if (~a eq)&(b eq)
|
||||
mov reg,a
|
||||
end if
|
||||
}
|
||||
|
||||
macro mcall a,b,c,d,e,f { ; mike.dld
|
||||
__mov eax,a
|
||||
__mov ebx,b
|
||||
__mov ecx,c
|
||||
__mov edx,d
|
||||
__mov esi,e
|
||||
__mov edi,f
|
||||
int 0x40
|
||||
}
|
||||
|
||||
|
||||
|
||||
; optimize the code for size
|
||||
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
|
||||
|
||||
macro add arg1,arg2
|
||||
{
|
||||
if (arg2 eqtype 0)
|
||||
if (arg2) = 1
|
||||
inc arg1
|
||||
else
|
||||
add arg1,arg2
|
||||
end if
|
||||
else
|
||||
add arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
macro sub arg1,arg2
|
||||
{
|
||||
if (arg2 eqtype 0)
|
||||
if (arg2) = 1
|
||||
dec arg1
|
||||
else
|
||||
sub arg1,arg2
|
||||
end if
|
||||
else
|
||||
sub arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
macro mov arg1,arg2
|
||||
{
|
||||
if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
|
||||
if (arg2) = 0
|
||||
xor arg1,arg1
|
||||
else if (arg2) = 1
|
||||
xor arg1,arg1
|
||||
inc arg1
|
||||
else if (arg2) = -1
|
||||
or arg1,-1
|
||||
else if (arg2) > -128 & (arg2) < 128
|
||||
push arg2
|
||||
pop arg1
|
||||
else
|
||||
mov arg1,arg2
|
||||
end if
|
||||
else
|
||||
mov arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
|
||||
macro struct name
|
||||
{
|
||||
virtual at 0
|
||||
name name
|
||||
sizeof.#name = $ - name
|
||||
end virtual
|
||||
}
|
||||
|
||||
; structures used in MeOS
|
||||
struc process_information
|
||||
{
|
||||
.cpu_usage dd ? ; +0
|
||||
.window_stack_position dw ? ; +4
|
||||
.window_stack_value dw ? ; +6
|
||||
.not_used1 dw ? ; +8
|
||||
.process_name rb 12 ; +10
|
||||
.memory_start dd ? ; +22
|
||||
.used_memory dd ? ; +26
|
||||
.PID dd ? ; +30
|
||||
.x_start dd ? ; +34
|
||||
.y_start dd ? ; +38
|
||||
.x_size dd ? ; +42
|
||||
.y_size dd ? ; +46
|
||||
.slot_state dw ? ; +50
|
||||
dw ? ; +52 - reserved
|
||||
.client_left dd ? ; +54
|
||||
.client_top dd ? ; +58
|
||||
.client_width dd ? ; +62
|
||||
.client_height dd ? ; +66
|
||||
.wnd_state db ? ; +70
|
||||
rb (1024-71)
|
||||
}
|
||||
struct process_information
|
||||
|
||||
struc system_colors
|
||||
{
|
||||
.frame dd ?
|
||||
.grab dd ?
|
||||
.grab_button dd ?
|
||||
.grab_button_text dd ?
|
||||
.grab_text dd ?
|
||||
.work dd ?
|
||||
.work_button dd ?
|
||||
.work_button_text dd ?
|
||||
.work_text dd ?
|
||||
.work_graph dd ?
|
||||
}
|
||||
struct system_colors
|
||||
|
||||
|
||||
; constants
|
||||
|
||||
; events
|
||||
EV_IDLE = 0
|
||||
EV_TIMER = 0
|
||||
EV_REDRAW = 1
|
||||
EV_KEY = 2
|
||||
EV_BUTTON = 3
|
||||
EV_EXIT = 4
|
||||
EV_BACKGROUND = 5
|
||||
EV_MOUSE = 6
|
||||
EV_IPC = 7
|
||||
EV_STACK = 8
|
||||
|
||||
; event mask bits for function 40
|
||||
EVM_REDRAW = 1b
|
||||
EVM_KEY = 10b
|
||||
EVM_BUTTON = 100b
|
||||
EVM_EXIT = 1000b
|
||||
EVM_BACKGROUND = 10000b
|
||||
EVM_MOUSE = 100000b
|
||||
EVM_IPC = 1000000b
|
||||
EVM_STACK = 10000000b
|
@ -1,123 +0,0 @@
|
||||
;
|
||||
; <20>ਬ¥à ¯à®£à ¬¬ë ¤«ï MenuetOS
|
||||
; ®§¢ã稢 ¥â ª®¤ ¦ ⮩ ª« ¢¨è¨ ;)
|
||||
;
|
||||
; Š®¬¯¨«¨à®¢ âì FASM'®¬
|
||||
;
|
||||
; ‘¬. â ª¦¥:
|
||||
; template.asm - ¯à¨¬¥à ¯à®á⥩襩 ¯à®£à ¬¬ë (®¢ë©!)
|
||||
; rb.asm - ª®â¥ªá⮥ ¬¥î à ¡®ç¥£® á⮫
|
||||
; example2.asm - ¯à¨¬¥à ¬¥î ¨ ¤®¯®«¨â¥«ìëå ®ª®
|
||||
; example3.asm - ¯à¨¬¥à ¬¥î, ॠ«¨§®¢ ®£® ¯®-¤à㣮¬ã
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
use32 ; ¢ª«îç¨âì 32-¡¨âë© à¥¦¨¬ áᥬ¡«¥à
|
||||
org 0x0 ; ¤à¥á æ¨ï á ã«ï
|
||||
|
||||
db 'MENUET01' ; 8-¡ ©âë© ¨¤¥â¨ä¨ª â®à MenuetOS
|
||||
dd 0x01 ; ¢¥àá¨ï § £®«®¢ª (¢á¥£¤ 1)
|
||||
dd START ; ¤à¥á ¯¥à¢®© ª®¬ ¤ë
|
||||
dd I_END ; à §¬¥à ¯à®£à ¬¬ë
|
||||
dd 0x1000 ; ª®«¨ç¥á⢮ ¯ ¬ïâ¨
|
||||
dd 0x1000 ; ¤à¥á ¢¥àè¨ë áâíª
|
||||
dd 0x0 ; ¤à¥á ¡ãä¥à ¤«ï ¯ à ¬¥â஢ (¥ ¨á¯®«ì§ã¥âáï)
|
||||
dd 0x0 ; § १¥à¢¨à®¢ ®
|
||||
|
||||
include 'MACROS.INC' ; ¬ ªà®áë ®¡«¥£ç îâ ¦¨§ì áᥬ¡«¥à騪®¢!
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
;--- <20>€—€‹Ž <20><>Žƒ<C5BD>€ŒŒ› ----------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
START:
|
||||
; mcall 5,10
|
||||
mov ecx, 1
|
||||
mov edx, drvinfo
|
||||
push @f
|
||||
jmp call_driver
|
||||
@@:
|
||||
; jmp run_launcher
|
||||
|
||||
mov ecx, 2
|
||||
push @f
|
||||
call_driver:
|
||||
mcall 21,13
|
||||
ret
|
||||
@@:
|
||||
; cmp eax,-1
|
||||
inc eax
|
||||
je run_launcher
|
||||
; cmp ecx,280
|
||||
; je change_vrr
|
||||
; cmp ecx,277
|
||||
; je change_vrr
|
||||
; cmp ecx,6
|
||||
; je change_vrr
|
||||
; cmp ecx,7
|
||||
; je change_vrr
|
||||
; jmp run_launcher
|
||||
change_vrr:
|
||||
; mov ax,cx
|
||||
; dec cx
|
||||
; shl cx,1
|
||||
; xor edx,edx
|
||||
; mov dx,[vidmode+ecx]
|
||||
; mov ebx,ecx
|
||||
; shl ebx,2
|
||||
; add ebx,ecx ; ebx=ebx*5
|
||||
; shr ax,8
|
||||
; dec ax
|
||||
; shl ax,1
|
||||
; add ebx,eax
|
||||
; ror edx,16
|
||||
; mov dx,[_m1+ebx]
|
||||
; rol edx,16
|
||||
;mov eax,ecx
|
||||
mov eax, 10
|
||||
cmp cx,277+3
|
||||
je yes_277
|
||||
cmp cx,274+3
|
||||
jne yes_280
|
||||
yes_274:
|
||||
add al,10
|
||||
yes_277:
|
||||
add al,10
|
||||
yes_280:
|
||||
mov edx, [_m1+eax-2]
|
||||
lea dx, [ecx-3]
|
||||
push run_launcher
|
||||
mov ecx, 3
|
||||
jmp call_driver
|
||||
run_launcher:
|
||||
mcall 70,launcher
|
||||
mcall -1
|
||||
|
||||
launcher:
|
||||
dd 7
|
||||
dd 0
|
||||
dd 0
|
||||
dd 0
|
||||
dd 0
|
||||
db 0
|
||||
prog: dd autorun_prog
|
||||
|
||||
autorun_prog db '/hd0/1/kolibri/bin/launcher',0
|
||||
I_END: ; ¬¥âª ª®æ ¯à®£à ¬¬ë
|
||||
db ? ; system loader will zero all memory after program end
|
||||
; this byte will be terminating zero for launcher string
|
||||
; \begin{Serge}
|
||||
; A you really believe it?
|
||||
; Áëàæåí, êòî âåðóåò, òåïëî åìó íà ñâåòå!
|
||||
; \end{Serge}
|
||||
drvinfo: ; 512 bytes driver info area
|
||||
; +0 - Full driver name
|
||||
; +32 - Driver version
|
||||
; +64 - Word List of support video modes (max 32 positions)
|
||||
; +128 - 5 words list of support vertical rate to each present mode
|
||||
org $+32
|
||||
drvver:
|
||||
org $+32
|
||||
vidmode:
|
||||
org $+64
|
||||
_m1:
|
||||
org drvinfo+200h
|
@ -1,554 +0,0 @@
|
||||
$Revision: 431 $
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;**********************************************************
|
||||
; Непосредственная работа с устройством СD (ATAPI)
|
||||
;**********************************************************
|
||||
; Автор исходного текста Кулаков Владимир Геннадьевич.
|
||||
; Адаптация и доработка Mario79
|
||||
|
||||
; Процедура для полного считывания всех
|
||||
; данных из сектора компакт-диска
|
||||
; Автор текста программы Кулаков Владимир Геннадьевич.
|
||||
|
||||
|
||||
; Максимальное количество повторений операции чтения
|
||||
MaxRetr equ 3
|
||||
; Предельное время ожидания готовности к приему команды
|
||||
; (в тиках)
|
||||
BSYWaitTime equ 1000 ;2
|
||||
|
||||
;*************************************************
|
||||
;* ПОЛНОЕ ЧТЕНИЕ СЕКТОРА КОМПАКТ-ДИСКА *
|
||||
;* Считываются данные пользователя, информация *
|
||||
;* субканала и контрольная информация *
|
||||
;* Входные параметры передаются через глобальные *
|
||||
;* перменные: *
|
||||
;* ChannelNumber - номер канала; *
|
||||
;* DiskNumber - номер диска на канале; *
|
||||
;* CDSectorAddress - адрес считываемого сектора. *
|
||||
;* Данные считывается в массив CDDataBuf. *
|
||||
;*************************************************
|
||||
ReadCD:
|
||||
pusha
|
||||
; Задать размер сектора
|
||||
mov [CDBlockSize],2048 ;2352
|
||||
; Очистить буфер пакетной команды
|
||||
call clear_packet_buffer
|
||||
; Сформировать пакетную команду для считывания
|
||||
; сектора данных
|
||||
; Задать код команды Read CD
|
||||
mov [PacketCommand],byte 0x28 ;0xBE
|
||||
; Задать адрес сектора
|
||||
mov AX,word [CDSectorAddress+2]
|
||||
xchg AL,AH
|
||||
mov word [PacketCommand+2],AX
|
||||
mov AX,word [CDSectorAddress]
|
||||
xchg AL,AH
|
||||
mov word [PacketCommand+4],AX
|
||||
; mov eax,[CDSectorAddress]
|
||||
; mov [PacketCommand+2],eax
|
||||
; Задать количество считываемых секторов
|
||||
mov [PacketCommand+8],byte 1
|
||||
; Задать считывание данных в полном объеме
|
||||
; mov [PacketCommand+9],byte 0xF8
|
||||
; Подать команду
|
||||
call SendPacketDatCommand
|
||||
; call test_mario79
|
||||
popa
|
||||
ret
|
||||
|
||||
;********************************************
|
||||
;* ЧТЕНИЕ СЕКТОРА С ПОВТОРАМИ *
|
||||
;* Многократное повторение чтения при сбоях *
|
||||
;********************************************
|
||||
ReadCDWRetr:
|
||||
pusha
|
||||
; Цикл, пока команда не выполнена успешно или не
|
||||
; исчерпано количество попыток
|
||||
mov ECX,MaxRetr
|
||||
@@NextRetr:
|
||||
; Подать команду
|
||||
call ReadCD
|
||||
cmp [DevErrorCode],0
|
||||
je @@End_4
|
||||
; Задержка на 2,5 секунды
|
||||
mov EAX,[timer_ticks]
|
||||
add EAX,250 ;50
|
||||
@@Wait:
|
||||
call change_task
|
||||
cmp EAX,[timer_ticks]
|
||||
ja @@Wait
|
||||
loop @@NextRetr
|
||||
; call test_mario79
|
||||
; Сообщение об ошибке
|
||||
; mov SI,offset ErrS
|
||||
; call FatalError
|
||||
@@End_4:
|
||||
popa
|
||||
ret
|
||||
|
||||
|
||||
; Универсальные процедуры, обеспечивающие выполнение
|
||||
; пакетных команд в режиме PIO
|
||||
;
|
||||
; Автор текста программы Кулаков Владимир Геннадьевич.
|
||||
|
||||
; Максимально допустимое время ожидания реакции
|
||||
; устройства на пакетную команду (в тиках)
|
||||
MaxCDWaitTime equ 1000 ;200 ;10 секунд
|
||||
|
||||
; Область памяти для формирования пакетной команды
|
||||
PacketCommand: rb 12 ;DB 12 DUP (?)
|
||||
; Область памяти для приема данных от дисковода
|
||||
;CDDataBuf DB 4096 DUP (0)
|
||||
; Размер принимаемого блока данных в байтах
|
||||
CDBlockSize DW ?
|
||||
; Адрес считываемого сектора данных
|
||||
CDSectorAddress: DD ?
|
||||
; Время начала очередной операции с диском
|
||||
TickCounter_1 DD 0
|
||||
; Время начала ожидания готовности устройства
|
||||
WURStartTime DD 0
|
||||
; указатель буфера для считывания
|
||||
CDDataBuf_pointer dd 0
|
||||
|
||||
;****************************************************
|
||||
;* ПОСЛАТЬ УСТРОЙСТВУ ATAPI ПАКЕТНУЮ КОМАНДУ, *
|
||||
;* ПРЕДУСМАТРИВАЮЩУЮ ПЕРЕДАЧУ ОДНОГО СЕКТОРА ДАННЫХ *
|
||||
;* РАЗМЕРОМ 2048 БАЙТ ОТ УСТРОЙСТВА К ХОСТУ *
|
||||
;* Входные параметры передаются через глобальные *
|
||||
;* перменные: *
|
||||
;* ChannelNumber - номер канала; *
|
||||
;* DiskNumber - номер диска на канале; *
|
||||
;* PacketCommand - 12-байтный командный пакет; *
|
||||
;* CDBlockSize - размер принимаемого блока данных. *
|
||||
;****************************************************
|
||||
SendPacketDatCommand:
|
||||
pushad
|
||||
; Задать режим CHS
|
||||
mov [ATAAddressMode],0
|
||||
; Послать ATA-команду передачи пакетной команды
|
||||
mov [ATAFeatures],0
|
||||
mov [ATASectorCount],0
|
||||
mov [ATASectorNumber],0
|
||||
; Загрузить размер передаваемого блока
|
||||
mov AX,[CDBlockSize]
|
||||
mov [ATACylinder],AX
|
||||
mov [ATAHead],0
|
||||
mov [ATACommand],0A0h
|
||||
call SendCommandToHDD_1
|
||||
; call test_mario79
|
||||
cmp [DevErrorCode],0 ;проверить код ошибки
|
||||
jne @@End_8 ;закончить, сохранив код ошибки
|
||||
|
||||
; Ожидание готовности дисковода к приему
|
||||
; пакетной команды
|
||||
mov DX,[ATABasePortAddr]
|
||||
add DX,7 ;порт 1х7h
|
||||
@@WaitDevice0:
|
||||
call change_task
|
||||
; Проверить время выполнения команды
|
||||
mov EAX,[timer_ticks]
|
||||
sub EAX,[TickCounter_1]
|
||||
cmp EAX,BSYWaitTime
|
||||
ja @@Err1_1 ;ошибка тайм-аута
|
||||
; Проверить готовность
|
||||
in AL,DX
|
||||
test AL,80h ;состояние сигнала BSY
|
||||
jnz @@WaitDevice0
|
||||
test AL,1 ;состояние сигнала ERR
|
||||
jnz @@Err6
|
||||
test AL,08h ;состояние сигнала DRQ
|
||||
jz @@WaitDevice0
|
||||
; Послать пакетную команду
|
||||
cli
|
||||
mov DX,[ATABasePortAddr]
|
||||
mov AX,[PacketCommand]
|
||||
out DX,AX
|
||||
mov AX,[PacketCommand+2]
|
||||
out DX,AX
|
||||
mov AX,[PacketCommand+4]
|
||||
out DX,AX
|
||||
mov AX,[PacketCommand+6]
|
||||
out DX,AX
|
||||
mov AX,[PacketCommand+8]
|
||||
out DX,AX
|
||||
mov AX,[PacketCommand+10]
|
||||
out DX,AX
|
||||
sti
|
||||
; Ожидание готовности данных
|
||||
mov DX,[ATABasePortAddr]
|
||||
add DX,7 ;порт 1х7h
|
||||
@@WaitDevice1:
|
||||
call change_task
|
||||
; Проверить время выполнения команды
|
||||
mov EAX,[timer_ticks]
|
||||
sub EAX,[TickCounter_1]
|
||||
cmp EAX,MaxCDWaitTime
|
||||
ja @@Err1_1 ;ошибка тайм-аута
|
||||
; Проверить готовность
|
||||
in AL,DX
|
||||
test AL,80h ;состояние сигнала BSY
|
||||
jnz @@WaitDevice1
|
||||
test AL,1 ;состояние сигнала ERR
|
||||
jnz @@Err6_temp
|
||||
test AL,08h ;состояние сигнала DRQ
|
||||
jz @@WaitDevice1
|
||||
cli
|
||||
; Принять блок данных от контроллера
|
||||
mov EDI,[CDDataBuf_pointer] ;0x7000 ;CDDataBuf
|
||||
; Загрузить адрес регистра данных контроллера
|
||||
mov DX,[ATABasePortAddr] ;порт 1x0h
|
||||
; Загрузить в счетчик размер блока в байтах
|
||||
mov CX,[CDBlockSize]
|
||||
; Вычислить размер блока в 16-разрядных словах
|
||||
shr CX,1 ;разделить размер блока на 2
|
||||
; Принять блок данных
|
||||
cld
|
||||
rep insw
|
||||
sti
|
||||
; Успешное завершение приема данных
|
||||
jmp @@End_8
|
||||
|
||||
; Записать код ошибки
|
||||
@@Err1_1:
|
||||
mov [DevErrorCode],1
|
||||
jmp @@End_8
|
||||
@@Err6_temp:
|
||||
mov [DevErrorCode],7
|
||||
jmp @@End_8
|
||||
@@Err6:
|
||||
mov [DevErrorCode],6
|
||||
|
||||
@@End_8:
|
||||
popad
|
||||
ret
|
||||
|
||||
|
||||
|
||||
;***********************************************
|
||||
;* ПОСЛАТЬ УСТРОЙСТВУ ATAPI ПАКЕТНУЮ КОМАНДУ, *
|
||||
;* НЕ ПРЕДУСМАТРИВАЮЩУЮ ПЕРЕДАЧИ ДАННЫХ *
|
||||
;* Входные параметры передаются через *
|
||||
;* глобальные перменные: *
|
||||
;* ChannelNumber - номер канала; *
|
||||
;* DiskNumber - номер диска на канале; *
|
||||
;* PacketCommand - 12-байтный командный пакет. *
|
||||
;***********************************************
|
||||
SendPacketNoDatCommand:
|
||||
pushad
|
||||
; Задать режим CHS
|
||||
mov [ATAAddressMode],0
|
||||
; Послать ATA-команду передачи пакетной команды
|
||||
mov [ATAFeatures],0
|
||||
mov [ATASectorCount],0
|
||||
mov [ATASectorNumber],0
|
||||
mov [ATACylinder],0
|
||||
mov [ATAHead],0
|
||||
mov [ATACommand],0A0h
|
||||
call SendCommandToHDD_1
|
||||
cmp [DevErrorCode],0 ;проверить код ошибки
|
||||
jne @@End_9 ;закончить, сохранив код ошибки
|
||||
; Ожидание готовности дисковода к приему
|
||||
; пакетной команды
|
||||
mov DX,[ATABasePortAddr]
|
||||
add DX,7 ;порт 1х7h
|
||||
@@WaitDevice0_1:
|
||||
call change_task
|
||||
; Проверить время ожидания
|
||||
mov EAX,[timer_ticks]
|
||||
sub EAX,[TickCounter_1]
|
||||
cmp EAX,BSYWaitTime
|
||||
ja @@Err1_3 ;ошибка тайм-аута
|
||||
; Проверить готовность
|
||||
in AL,DX
|
||||
test AL,80h ;состояние сигнала BSY
|
||||
jnz @@WaitDevice0_1
|
||||
test AL,1 ;состояние сигнала ERR
|
||||
jnz @@Err6_1
|
||||
test AL,08h ;состояние сигнала DRQ
|
||||
jz @@WaitDevice0_1
|
||||
; Послать пакетную команду
|
||||
; cli
|
||||
mov DX,[ATABasePortAddr]
|
||||
mov AX,word [PacketCommand]
|
||||
out DX,AX
|
||||
mov AX,word [PacketCommand+2]
|
||||
out DX,AX
|
||||
mov AX,word [PacketCommand+4]
|
||||
out DX,AX
|
||||
mov AX,word [PacketCommand+6]
|
||||
out DX,AX
|
||||
mov AX,word [PacketCommand+8]
|
||||
out DX,AX
|
||||
mov AX,word [PacketCommand+10]
|
||||
out DX,AX
|
||||
; sti
|
||||
; Ожидание подтверждения приема команды
|
||||
mov DX,[ATABasePortAddr]
|
||||
add DX,7 ;порт 1х7h
|
||||
@@WaitDevice1_1:
|
||||
call change_task
|
||||
; Проверить время выполнения команды
|
||||
mov EAX,[timer_ticks]
|
||||
sub EAX,[TickCounter_1]
|
||||
cmp EAX,MaxCDWaitTime
|
||||
ja @@Err1_3 ;ошибка тайм-аута
|
||||
; Ожидать освобождения устройства
|
||||
in AL,DX
|
||||
test AL,80h ;состояние сигнала BSY
|
||||
jnz @@WaitDevice1_1
|
||||
test AL,1 ;состояние сигнала ERR
|
||||
jnz @@Err6_1
|
||||
test AL,40h ;состояние сигнала DRDY
|
||||
jz @@WaitDevice1_1
|
||||
jmp @@End_9
|
||||
|
||||
; Записать код ошибки
|
||||
@@Err1_3:
|
||||
mov [DevErrorCode],1
|
||||
jmp @@End_9
|
||||
@@Err6_1:
|
||||
mov [DevErrorCode],6
|
||||
@@End_9:
|
||||
popad
|
||||
ret
|
||||
|
||||
;****************************************************
|
||||
;* ПОСЛАТЬ КОМАНДУ ЗАДАННОМУ ДИСКУ *
|
||||
;* Входные параметры передаются через глобальные *
|
||||
;* переменные: *
|
||||
;* ChannelNumber - номер канала (1 или 2); *
|
||||
;* DiskNumber - номер диска (0 или 1); *
|
||||
;* ATAFeatures - "особенности"; *
|
||||
;* ATASectorCount - количество секторов; *
|
||||
;* ATASectorNumber - номер начального сектора; *
|
||||
;* ATACylinder - номер начального цилиндра; *
|
||||
;* ATAHead - номер начальной головки; *
|
||||
;* ATAAddressMode - режим адресации (0-CHS, 1-LBA); *
|
||||
;* ATACommand - код команды. *
|
||||
;* После успешного выполнения функции: *
|
||||
;* в ATABasePortAddr - базовый адрес HDD; *
|
||||
;* в DevErrorCode - ноль. *
|
||||
;* При возникновении ошибки в DevErrorCode будет *
|
||||
;* возвращен код ошибки. *
|
||||
;****************************************************
|
||||
SendCommandToHDD_1:
|
||||
pushad
|
||||
; Проверить значение кода режима
|
||||
cmp [ATAAddressMode],1
|
||||
ja @@Err2_4
|
||||
; Проверить корректность номера канала
|
||||
mov BX,[ChannelNumber]
|
||||
cmp BX,1
|
||||
jb @@Err3_4
|
||||
cmp BX,2
|
||||
ja @@Err3_4
|
||||
; Установить базовый адрес
|
||||
dec BX
|
||||
shl BX,1
|
||||
movzx ebx,bx
|
||||
mov AX,[ebx+StandardATABases]
|
||||
mov [ATABasePortAddr],AX
|
||||
; Ожидание готовности HDD к приему команды
|
||||
; Выбрать нужный диск
|
||||
mov DX,[ATABasePortAddr]
|
||||
add DX,6 ;адрес регистра головок
|
||||
mov AL,[DiskNumber]
|
||||
cmp AL,1 ;проверить номера диска
|
||||
ja @@Err4_4
|
||||
shl AL,4
|
||||
or AL,10100000b
|
||||
out DX,AL
|
||||
; Ожидать, пока диск не будет готов
|
||||
inc DX
|
||||
; mov ecx,0xfff
|
||||
mov eax,[timer_ticks]
|
||||
mov [TickCounter_1],eax
|
||||
@@WaitHDReady_2:
|
||||
call change_task
|
||||
; Проверить время ожидания
|
||||
; dec ecx
|
||||
; cmp ecx,0
|
||||
; je @@Err1
|
||||
mov eax,[timer_ticks]
|
||||
sub eax,[TickCounter_1]
|
||||
cmp eax,BSYWaitTime ;300 ;ожидать 3 сек.
|
||||
ja @@Err1_4 ;ошибка тайм-аута
|
||||
; Прочитать регистр состояния
|
||||
in AL,DX
|
||||
; Проверить состояние сигнала BSY
|
||||
test AL,80h
|
||||
jnz @@WaitHDReady_2
|
||||
; Проверить состояние сигнала DRQ
|
||||
test AL,08h
|
||||
jnz @@WaitHDReady_2
|
||||
; Загрузить команду в регистры контроллера
|
||||
cli
|
||||
mov DX,[ATABasePortAddr]
|
||||
inc DX ;регистр "особенностей"
|
||||
mov AL,[ATAFeatures]
|
||||
out DX,AL
|
||||
inc DX ;счетчик секторов
|
||||
mov AL,[ATASectorCount]
|
||||
out DX,AL
|
||||
inc DX ;регистр номера сектора
|
||||
mov AL,[ATASectorNumber]
|
||||
out DX,AL
|
||||
inc DX ;номер цилиндра (младший байт)
|
||||
mov AX,[ATACylinder]
|
||||
out DX,AL
|
||||
inc DX ;номер цилиндра (старший байт)
|
||||
mov AL,AH
|
||||
out DX,AL
|
||||
inc DX ;номер головки/номер диска
|
||||
mov AL,[DiskNumber]
|
||||
shl AL,4
|
||||
cmp [ATAHead],0Fh ;проверить номер головки
|
||||
ja @@Err5_4
|
||||
or AL,[ATAHead]
|
||||
or AL,10100000b
|
||||
mov AH,[ATAAddressMode]
|
||||
shl AH,6
|
||||
or AL,AH
|
||||
out DX,AL
|
||||
; Послать команду
|
||||
mov AL,[ATACommand]
|
||||
inc DX ;регистр команд
|
||||
out DX,AL
|
||||
sti
|
||||
; Сбросить признак ошибки
|
||||
mov [DevErrorCode],0
|
||||
jmp @@End_10
|
||||
; Записать код ошибки
|
||||
@@Err1_4:
|
||||
mov [DevErrorCode],1
|
||||
jmp @@End_10
|
||||
@@Err2_4:
|
||||
mov [DevErrorCode],2
|
||||
jmp @@End_10
|
||||
@@Err3_4:
|
||||
mov [DevErrorCode],3
|
||||
jmp @@End_10
|
||||
@@Err4_4:
|
||||
mov [DevErrorCode],4
|
||||
jmp @@End_10
|
||||
@@Err5_4:
|
||||
mov [DevErrorCode],5
|
||||
; Завершение работы программы
|
||||
@@End_10:
|
||||
sti
|
||||
popad
|
||||
ret
|
||||
|
||||
;*************************************************
|
||||
;* ОЖИДАНИЕ ГОТОВНОСТИ УСТРОЙСТВА К РАБОТЕ *
|
||||
;* Входные параметры передаются через глобальные *
|
||||
;* перменные: *
|
||||
;* ChannelNumber - номер канала; *
|
||||
;* DiskNumber - номер диска на канале. *
|
||||
;*************************************************
|
||||
WaitUnitReady:
|
||||
pusha
|
||||
; Запомнить время начала операции
|
||||
mov EAX,[timer_ticks]
|
||||
mov [WURStartTime],EAX
|
||||
; Очистить буфер пакетной команды
|
||||
call clear_packet_buffer
|
||||
; Сформировать команду TEST UNIT READY
|
||||
mov [PacketCommand],word 00h
|
||||
; ЦИКЛ ОЖИДАНИЯ ГОТОВНОСТИ УСТРОЙСТВА
|
||||
@@SendCommand:
|
||||
; Подать команду проверки готовности
|
||||
call SendPacketNoDatCommand
|
||||
call change_task
|
||||
; Проверить код ошибки
|
||||
cmp [DevErrorCode],0
|
||||
je @@End_11
|
||||
; Проверить время ожидания готовности
|
||||
mov EAX,[timer_ticks]
|
||||
sub EAX,[WURStartTime]
|
||||
cmp EAX,MaxCDWaitTime
|
||||
jb @@SendCommand
|
||||
; Ошибка тайм-аута
|
||||
mov [DevErrorCode],1
|
||||
@@End_11:
|
||||
popa
|
||||
ret
|
||||
|
||||
|
||||
;*************************************************
|
||||
;* ЗАГРУЗИТЬ НОСИТЕЛЬ В ДИСКОВОД *
|
||||
;* Входные параметры передаются через глобальные *
|
||||
;* перменные: *
|
||||
;* ChannelNumber - номер канала; *
|
||||
;* DiskNumber - номер диска на канале. *
|
||||
;*************************************************
|
||||
LoadMedium:
|
||||
pusha
|
||||
; Очистить буфер пакетной команды
|
||||
call clear_packet_buffer
|
||||
; Сформировать команду START/STOP UNIT
|
||||
; Задать код команды
|
||||
mov [PacketCommand],word 1Bh
|
||||
; Задать операцию загрузки носителя
|
||||
mov [PacketCommand+4],word 00000011b
|
||||
; Подать команду
|
||||
call SendPacketNoDatCommand
|
||||
popa
|
||||
ret
|
||||
|
||||
;*************************************************
|
||||
;* ИЗВЛЕЧЬ НОСИТЕЛЬ ИЗ ДИСКОВОДА *
|
||||
;* Входные параметры передаются через глобальные *
|
||||
;* перменные: *
|
||||
;* ChannelNumber - номер канала; *
|
||||
;* DiskNumber - номер диска на канале. *
|
||||
;*************************************************
|
||||
UnloadMedium:
|
||||
pusha
|
||||
; Очистить буфер пакетной команды
|
||||
call clear_packet_buffer
|
||||
; Сформировать команду START/STOP UNIT
|
||||
; Задать код команды
|
||||
mov [PacketCommand],word 1Bh
|
||||
; Задать операцию извлечения носителя
|
||||
mov [PacketCommand+4],word 00000010b
|
||||
; Подать команду
|
||||
call SendPacketNoDatCommand
|
||||
popa
|
||||
ret
|
||||
|
||||
;*************************************************
|
||||
;* ОПРЕДЕЛИТЬ ОБЩЕЕ КОЛИЧЕСТВО СЕКТОРОВ НА ДИСКЕ *
|
||||
;* Входные параметры передаются через глобальные *
|
||||
;* переменные: *
|
||||
;* ChannelNumber - номер канала; *
|
||||
;* DiskNumber - номер диска на канале. *
|
||||
;*************************************************
|
||||
ReadCapacity:
|
||||
pusha
|
||||
; Очистить буфер пакетной команды
|
||||
call clear_packet_buffer
|
||||
; Задать размер буфера в байтах
|
||||
mov [CDBlockSize],8
|
||||
; Сформировать команду READ CAPACITY
|
||||
mov [PacketCommand],word 25h
|
||||
; Подать команду
|
||||
call SendPacketDatCommand
|
||||
popa
|
||||
ret
|
||||
|
||||
clear_packet_buffer:
|
||||
; Очистить буфер пакетной команды
|
||||
mov [PacketCommand],dword 0
|
||||
mov [PacketCommand+4],dword 0
|
||||
mov [PacketCommand+8],dword 0
|
||||
ret
|
||||
|
@ -1,269 +0,0 @@
|
||||
$Revision: 431 $
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
sys_cd_audio:
|
||||
|
||||
cmp word [cdbase],word 0
|
||||
jnz @f
|
||||
mov eax,1
|
||||
ret
|
||||
@@:
|
||||
|
||||
; eax=1 cdplay at ebx 0x00FFSSMM
|
||||
; eax=2 get tracklist size of ecx to [ebx]
|
||||
; eax=3 stop/pause playing
|
||||
|
||||
cmp eax,1
|
||||
jnz nocdp
|
||||
call sys_cdplay
|
||||
ret
|
||||
nocdp:
|
||||
|
||||
cmp eax,2
|
||||
jnz nocdtl
|
||||
mov edi,[TASK_BASE]
|
||||
add edi,TASKDATA.mem_start
|
||||
add ebx,[edi]
|
||||
call sys_cdtracklist
|
||||
ret
|
||||
nocdtl:
|
||||
|
||||
cmp eax,3
|
||||
jnz nocdpause
|
||||
call sys_cdpause
|
||||
ret
|
||||
nocdpause:
|
||||
|
||||
mov eax,0xffffff01
|
||||
ret
|
||||
|
||||
|
||||
|
||||
sys_cd_atapi_command:
|
||||
|
||||
pushad
|
||||
|
||||
mov dx,word [cdbase]
|
||||
add dx,6
|
||||
mov ax,word [cdid]
|
||||
out dx,al
|
||||
mov esi,10
|
||||
call delay_ms
|
||||
mov dx,word [cdbase]
|
||||
add dx,7
|
||||
in al,dx
|
||||
and al,0x80
|
||||
cmp al,0
|
||||
jnz res
|
||||
jmp cdl6
|
||||
res:
|
||||
mov dx,word [cdbase]
|
||||
add dx,7
|
||||
mov al,0x8
|
||||
out dx,al
|
||||
mov dx,word [cdbase]
|
||||
add dx,0x206
|
||||
mov al,0xe
|
||||
out dx,al
|
||||
mov esi,1
|
||||
call delay_ms
|
||||
mov dx,word [cdbase]
|
||||
add dx,0x206
|
||||
mov al,0x8
|
||||
out dx,al
|
||||
mov esi,30
|
||||
call delay_ms
|
||||
xor cx,cx
|
||||
cdl5:
|
||||
inc cx
|
||||
cmp cx,10
|
||||
jz cdl6
|
||||
mov dx,word [cdbase]
|
||||
add dx,7
|
||||
in al,dx
|
||||
and al,0x88
|
||||
cmp al,0x00
|
||||
jz cdl5
|
||||
mov esi,100
|
||||
call delay_ms
|
||||
jmp cdl5
|
||||
cdl6:
|
||||
mov dx,word [cdbase]
|
||||
add dx,4
|
||||
mov al,0
|
||||
out dx,al
|
||||
mov dx,word [cdbase]
|
||||
add dx,5
|
||||
mov al,0
|
||||
out dx,al
|
||||
mov dx,word [cdbase]
|
||||
add dx,7
|
||||
mov al,0xec
|
||||
out dx,al
|
||||
mov esi,5
|
||||
call delay_ms
|
||||
mov dx,word [cdbase]
|
||||
add dx,1
|
||||
mov al,0
|
||||
out dx,al
|
||||
add dx,1
|
||||
mov al,0
|
||||
out dx,al
|
||||
add dx,1
|
||||
mov al,0
|
||||
out dx,al
|
||||
add dx,1
|
||||
mov al,0
|
||||
out dx,al
|
||||
add dx,1
|
||||
mov al,128
|
||||
out dx,al
|
||||
add dx,2
|
||||
mov al,0xa0
|
||||
out dx,al
|
||||
xor cx,cx
|
||||
mov dx,word [cdbase]
|
||||
add dx,7
|
||||
cdl1:
|
||||
inc cx
|
||||
cmp cx,100
|
||||
jz cdl2
|
||||
in al,dx
|
||||
and ax,0x88
|
||||
cmp al,0x8
|
||||
jz cdl2
|
||||
mov esi,2
|
||||
call delay_ms
|
||||
jmp cdl1
|
||||
cdl2:
|
||||
|
||||
popad
|
||||
ret
|
||||
|
||||
|
||||
sys_cdplay:
|
||||
|
||||
mov ax,5
|
||||
push ax
|
||||
push ebx
|
||||
cdplay:
|
||||
call sys_cd_atapi_command
|
||||
cli
|
||||
mov dx,word [cdbase]
|
||||
mov ax,0x0047
|
||||
out dx,ax
|
||||
mov al,1
|
||||
mov ah,[esp+0] ; min xx
|
||||
out dx,ax
|
||||
mov ax,[esp+1] ; fr sec
|
||||
out dx,ax
|
||||
mov ax,256+99
|
||||
out dx,ax
|
||||
mov ax,0x0001
|
||||
out dx,ax
|
||||
mov ax,0x0000
|
||||
out dx,ax
|
||||
mov esi,10
|
||||
call delay_ms
|
||||
sti
|
||||
add dx,7
|
||||
in al,dx
|
||||
test al,1
|
||||
jz cdplayok
|
||||
mov ax,[esp+4]
|
||||
dec ax
|
||||
mov [esp+4],ax
|
||||
cmp ax,0
|
||||
jz cdplayfail
|
||||
jmp cdplay
|
||||
cdplayfail:
|
||||
cdplayok:
|
||||
pop ebx
|
||||
pop ax
|
||||
xor eax, eax
|
||||
ret
|
||||
|
||||
|
||||
sys_cdtracklist:
|
||||
|
||||
push ebx
|
||||
tcdplay:
|
||||
call sys_cd_atapi_command
|
||||
mov dx,word [cdbase]
|
||||
mov ax,0x43+2*256
|
||||
out dx,ax
|
||||
mov ax,0x0
|
||||
out dx,ax
|
||||
mov ax,0x0
|
||||
out dx,ax
|
||||
mov ax,0x0
|
||||
out dx,ax
|
||||
mov ax,200
|
||||
out dx,ax
|
||||
mov ax,0x0
|
||||
out dx,ax
|
||||
in al,dx
|
||||
mov cx,1000
|
||||
mov dx,word [cdbase]
|
||||
add dx,7
|
||||
cld
|
||||
cdtrnwewait:
|
||||
mov esi,10
|
||||
call delay_ms
|
||||
in al,dx
|
||||
and al,128
|
||||
cmp al,0
|
||||
jz cdtrl1
|
||||
loop cdtrnwewait
|
||||
cdtrl1:
|
||||
; read the result
|
||||
mov ecx,[esp+0]
|
||||
mov dx,word [cdbase]
|
||||
cdtrread:
|
||||
add dx,7
|
||||
in al,dx
|
||||
and al,8
|
||||
cmp al,8
|
||||
jnz cdtrdone
|
||||
sub dx,7
|
||||
in ax,dx
|
||||
mov [ecx],ax
|
||||
add ecx,2
|
||||
jmp cdtrread
|
||||
cdtrdone:
|
||||
pop ecx
|
||||
xor eax, eax
|
||||
ret
|
||||
|
||||
|
||||
sys_cdpause:
|
||||
|
||||
call sys_cd_atapi_command
|
||||
|
||||
mov dx,word [cdbase]
|
||||
mov ax,0x004B
|
||||
out dx,ax
|
||||
mov ax,0
|
||||
out dx,ax
|
||||
mov ax,0
|
||||
out dx,ax
|
||||
mov ax,0
|
||||
out dx,ax
|
||||
mov ax,0
|
||||
out dx,ax
|
||||
mov ax,0
|
||||
out dx,ax
|
||||
|
||||
mov esi,10
|
||||
call delay_ms
|
||||
add dx,7
|
||||
in al,dx
|
||||
|
||||
xor eax, eax
|
||||
ret
|
||||
|
@ -1,82 +0,0 @@
|
||||
$Revision: 431 $
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
|
||||
iglobal
|
||||
;function pointers.
|
||||
fdc_irq_func dd fdc_null
|
||||
endg
|
||||
|
||||
uglobal
|
||||
dmasize db 0x0
|
||||
dmamode db 0x0
|
||||
endg
|
||||
|
||||
fdc_init: ;start with clean tracks.
|
||||
mov edi,OS_BASE+0xD201
|
||||
mov al,0
|
||||
mov ecx,160
|
||||
rep stosb
|
||||
ret
|
||||
|
||||
fdc_filesave: ;ebx: cluster to be saved.
|
||||
pusha ;returns immediately. does not trigger a write.
|
||||
mov eax,ebx
|
||||
add eax,31
|
||||
mov bl,18
|
||||
div bl
|
||||
mov ah,0
|
||||
add eax,OS_BASE+0xD201
|
||||
mov [eax],byte 1 ;This track is now dirty.
|
||||
popa
|
||||
ret
|
||||
|
||||
fdc_irq:
|
||||
call [fdc_irq_func]
|
||||
fdc_null:
|
||||
ret
|
||||
|
||||
save_image:
|
||||
call reserve_flp
|
||||
call restorefatchain
|
||||
pusha
|
||||
call check_label
|
||||
cmp [FDC_Status],0
|
||||
jne unnecessary_save_image
|
||||
mov [FDD_Track],0 ; Öèëèíäð
|
||||
mov [FDD_Head],0 ; Ñòîðîíà
|
||||
mov [FDD_Sector],1 ; Ñåêòîð
|
||||
mov esi,RAMDISK
|
||||
call SeekTrack
|
||||
save_image_1:
|
||||
push esi
|
||||
call take_data_from_application_1
|
||||
pop esi
|
||||
add esi,512
|
||||
call WriteSectWithRetr
|
||||
; call WriteSector
|
||||
cmp [FDC_Status],0
|
||||
jne unnecessary_save_image
|
||||
inc [FDD_Sector]
|
||||
cmp [FDD_Sector],19
|
||||
jne save_image_1
|
||||
mov [FDD_Sector],1
|
||||
inc [FDD_Head]
|
||||
cmp [FDD_Head],2
|
||||
jne save_image_1
|
||||
mov [FDD_Head],0
|
||||
inc [FDD_Track]
|
||||
call SeekTrack
|
||||
cmp [FDD_Track],80
|
||||
jne save_image_1
|
||||
unnecessary_save_image:
|
||||
mov [fdc_irq_func],fdc_null
|
||||
popa
|
||||
mov [flp_status],0
|
||||
ret
|
||||
|
@ -1,623 +0,0 @@
|
||||
$Revision: 431 $
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;**********************************************************
|
||||
; Непосредственная работа с контроллером гибкого диска
|
||||
;**********************************************************
|
||||
; Автор исходного текста Кулаков Владимир Геннадьевич.
|
||||
; Адаптация и доработка Mario79
|
||||
|
||||
give_back_application_data: ; переслать приложению
|
||||
mov edi,[TASK_BASE]
|
||||
mov edi,[edi+TASKDATA.mem_start]
|
||||
add edi,ecx
|
||||
give_back_application_data_1:
|
||||
mov esi,FDD_BUFF ;FDD_DataBuffer ;0x40000
|
||||
xor ecx,ecx
|
||||
mov cx,128
|
||||
cld
|
||||
rep movsd
|
||||
ret
|
||||
|
||||
take_data_from_application: ; взять из приложени
|
||||
mov esi,[TASK_BASE]
|
||||
mov esi,[esi+TASKDATA.mem_start]
|
||||
add esi,ecx
|
||||
take_data_from_application_1:
|
||||
mov edi,FDD_BUFF ;FDD_DataBuffer ;0x40000
|
||||
xor ecx,ecx
|
||||
mov cx,128
|
||||
cld
|
||||
rep movsd
|
||||
ret
|
||||
|
||||
; Коды завершения операции с контроллером (FDC_Status)
|
||||
FDC_Normal equ 0 ;нормальное завершение
|
||||
FDC_TimeOut equ 1 ;ошибка тайм-аута
|
||||
FDC_DiskNotFound equ 2 ;в дисководе нет диска
|
||||
FDC_TrackNotFound equ 3 ;дорожка не найдена
|
||||
FDC_SectorNotFound equ 4 ;сектор не найден
|
||||
|
||||
; Максимальные значения координат сектора (заданные
|
||||
; значения соответствуют параметрам стандартного
|
||||
; трехдюймового гибкого диска объемом 1,44 Мб)
|
||||
MAX_Track equ 79
|
||||
MAX_Head equ 1
|
||||
MAX_Sector equ 18
|
||||
|
||||
uglobal
|
||||
; Счетчик тиков таймера
|
||||
TickCounter dd ?
|
||||
; Код завершения операции с контроллером НГМД
|
||||
FDC_Status DB ?
|
||||
; Флаг прерывания от НГМД
|
||||
FDD_IntFlag DB ?
|
||||
; Момент начала последней операции с НГМД
|
||||
FDD_Time DD ?
|
||||
; Номер дисковода
|
||||
FDD_Type db 0
|
||||
; Координаты сектора
|
||||
FDD_Track DB ?
|
||||
FDD_Head DB ?
|
||||
FDD_Sector DB ?
|
||||
|
||||
; Блок результата операции
|
||||
FDC_ST0 DB ?
|
||||
FDC_ST1 DB ?
|
||||
FDC_ST2 DB ?
|
||||
FDC_C DB ?
|
||||
FDC_H DB ?
|
||||
FDC_R DB ?
|
||||
FDC_N DB ?
|
||||
; Счетчик повторения операции чтени
|
||||
ReadRepCounter DB ?
|
||||
; Счетчик повторения операции рекалибровки
|
||||
RecalRepCounter DB ?
|
||||
endg
|
||||
; Область памяти для хранения прочитанного сектора
|
||||
;FDD_DataBuffer: times 512 db 0 ;DB 512 DUP (?)
|
||||
fdd_motor_status db 0
|
||||
timer_fdd_motor dd 0
|
||||
|
||||
;*************************************
|
||||
;* ИНИЦИАЛИЗАЦИЯ РЕЖИМА ПДП ДЛЯ НГМД *
|
||||
;*************************************
|
||||
Init_FDC_DMA:
|
||||
pushad
|
||||
mov al,0
|
||||
out 0x0c,al ; reset the flip-flop to a known state.
|
||||
mov al,6 ; mask channel 2 so we can reprogram it.
|
||||
out 0x0a,al
|
||||
mov al,[dmamode] ; 0x46 -> Read from floppy - 0x4A Write to floppy
|
||||
out 0x0b,al
|
||||
mov al,0
|
||||
out 0x0c,al ; reset the flip-flop to a known state.
|
||||
mov eax,0xD000
|
||||
out 0x04,al ; set the channel 2 starting address to 0
|
||||
shr eax,8
|
||||
out 0x04,al
|
||||
shr eax,8
|
||||
out 0x81,al
|
||||
mov al,0
|
||||
out 0x0c, al ; reset flip-flop
|
||||
mov al, 0xff ;set count (actual size -1)
|
||||
out 0x5, al
|
||||
mov al,0x1 ;[dmasize] ;(0x1ff = 511 / 0x23ff =9215)
|
||||
out 0x5,al
|
||||
mov al,2
|
||||
out 0xa,al
|
||||
popad
|
||||
ret
|
||||
|
||||
;***********************************
|
||||
;* ЗАПИСАТЬ БАЙТ В ПОРТ ДАННЫХ FDC *
|
||||
;* Параметры: *
|
||||
;* AL - выводимый байт. *
|
||||
;***********************************
|
||||
FDCDataOutput:
|
||||
; pusha
|
||||
push eax ecx edx
|
||||
mov AH,AL ;запомнить байт в AH
|
||||
; Сбросить переменную состояния контроллера
|
||||
mov [FDC_Status],FDC_Normal
|
||||
; Проверить готовность контроллера к приему данных
|
||||
mov DX,3F4h ;(порт состояния FDC)
|
||||
mov ecx, 0x10000 ;установить счетчик тайм-аута
|
||||
@@TestRS:
|
||||
in AL,DX ;прочитать регистр RS
|
||||
and AL,0C0h ;выделить разряды 6 и 7
|
||||
cmp AL,80h ;проверить разряды 6 и 7
|
||||
je @@OutByteToFDC
|
||||
loop @@TestRS
|
||||
; Ошибка тайм-аута
|
||||
mov [FDC_Status],FDC_TimeOut
|
||||
jmp @@End_5
|
||||
; Вывести байт в порт данных
|
||||
@@OutByteToFDC:
|
||||
inc DX
|
||||
mov AL,AH
|
||||
out DX,AL
|
||||
@@End_5:
|
||||
; popa
|
||||
pop edx ecx eax
|
||||
ret
|
||||
|
||||
;******************************************
|
||||
;* ПРОЧИТАТЬ БАЙТ ИЗ ПОРТА ДАННЫХ FDC *
|
||||
;* Процедура не имеет входных параметров. *
|
||||
;* Выходные данные: *
|
||||
;* AL - считанный байт. *
|
||||
;******************************************
|
||||
FDCDataInput:
|
||||
push ECX
|
||||
push DX
|
||||
; Сбросить переменную состояния контроллера
|
||||
mov [FDC_Status],FDC_Normal
|
||||
; Проверить готовность контроллера к передаче данных
|
||||
mov DX,3F4h ;(порт состояния FDC)
|
||||
xor CX,CX ;установить счетчик тайм-аута
|
||||
@@TestRS_1:
|
||||
in AL,DX ;прочитать регистр RS
|
||||
and AL,0C0h ;выдлить разряды 6 и 7
|
||||
cmp AL,0C0h ;проверить разряды 6 и 7
|
||||
je @@GetByteFromFDC
|
||||
loop @@TestRS_1
|
||||
; Ошибка тайм-аута
|
||||
mov [FDC_Status],FDC_TimeOut
|
||||
jmp @@End_6
|
||||
; Ввести байт из порта данных
|
||||
@@GetByteFromFDC:
|
||||
inc DX
|
||||
in AL,DX
|
||||
@@End_6: pop DX
|
||||
pop ECX
|
||||
ret
|
||||
|
||||
;*********************************************
|
||||
;* ОБРАБОТЧИК ПРЕРЫВАНИЯ ОТ КОНТРОЛЛЕРА НГМД *
|
||||
;*********************************************
|
||||
FDCInterrupt:
|
||||
; Установить флаг прерывани
|
||||
mov [FDD_IntFlag],1
|
||||
ret
|
||||
|
||||
|
||||
;******************************************
|
||||
;* УСТАНОВИТЬ НОВЫЙ ОБРАБОТЧИК ПРЕРЫВАНИЙ *
|
||||
;* НГМД *
|
||||
;******************************************
|
||||
SetUserInterrupts:
|
||||
mov [fdc_irq_func],FDCInterrupt
|
||||
ret
|
||||
|
||||
;*******************************************
|
||||
;* ОЖИДАНИЕ ПРЕРЫВАНИЯ ОТ КОНТРОЛЛЕРА НГМД *
|
||||
;*******************************************
|
||||
WaitFDCInterrupt:
|
||||
pusha
|
||||
; Сбросить байт состояния операции
|
||||
mov [FDC_Status],FDC_Normal
|
||||
; Сбросить флаг прерывани
|
||||
mov [FDD_IntFlag],0
|
||||
; Обнулить счетчик тиков
|
||||
mov eax,[timer_ticks]
|
||||
mov [TickCounter],eax
|
||||
; Ожидать установки флага прерывания НГМД
|
||||
@@TestRS_2:
|
||||
cmp [FDD_IntFlag],0
|
||||
jnz @@End_7 ;прерывание произошло
|
||||
call change_task
|
||||
mov eax,[timer_ticks]
|
||||
sub eax,[TickCounter]
|
||||
cmp eax,50 ;25 ;5 ;ожидать 5 тиков
|
||||
jb @@TestRS_2
|
||||
; jl @@TestRS_2
|
||||
; Ошибка тайм-аута
|
||||
mov [FDC_Status],FDC_TimeOut
|
||||
; mov [flp_status],0
|
||||
@@End_7: popa
|
||||
ret
|
||||
|
||||
;*********************************
|
||||
;* ВКЛЮЧИТЬ МОТОР ДИСКОВОДА "A:" *
|
||||
;*********************************
|
||||
FDDMotorON:
|
||||
pusha
|
||||
; cmp [fdd_motor_status],1
|
||||
; je fdd_motor_on
|
||||
mov al,[flp_number]
|
||||
cmp [fdd_motor_status],al
|
||||
je fdd_motor_on
|
||||
; Произвести сброс контроллера НГМД
|
||||
mov DX,3F2h ;порт управления двигателями
|
||||
mov AL,0
|
||||
out DX,AL
|
||||
; Выбрать и включить мотор дисковода
|
||||
cmp [flp_number],1
|
||||
jne FDDMotorON_B
|
||||
; call FDDMotorOFF_B
|
||||
mov AL,1Ch ; Floppy A
|
||||
jmp FDDMotorON_1
|
||||
FDDMotorON_B:
|
||||
; call FDDMotorOFF_A
|
||||
mov AL,2Dh ; Floppy B
|
||||
FDDMotorON_1:
|
||||
out DX,AL
|
||||
; Обнулить счетчик тиков
|
||||
mov eax,[timer_ticks]
|
||||
mov [TickCounter],eax
|
||||
; Ожидать 0,5 с
|
||||
@@dT:
|
||||
call change_task
|
||||
mov eax,[timer_ticks]
|
||||
sub eax,[TickCounter]
|
||||
cmp eax,50 ;10
|
||||
jb @@dT
|
||||
cmp [flp_number],1
|
||||
jne fdd_motor_on_B
|
||||
mov [fdd_motor_status],1
|
||||
jmp fdd_motor_on
|
||||
fdd_motor_on_B:
|
||||
mov [fdd_motor_status],2
|
||||
fdd_motor_on:
|
||||
call save_timer_fdd_motor
|
||||
popa
|
||||
ret
|
||||
|
||||
;*****************************************
|
||||
;* СОХРАНЕНИЕ УКАЗАТЕЛЯ ВРЕМЕНИ *
|
||||
;*****************************************
|
||||
save_timer_fdd_motor:
|
||||
mov eax,[timer_ticks]
|
||||
mov [timer_fdd_motor],eax
|
||||
ret
|
||||
|
||||
;*****************************************
|
||||
;* ПРОВЕРКА ЗАДЕРЖКИ ВЫКЛЮЧЕНИЯ МОТОРА *
|
||||
;*****************************************
|
||||
check_fdd_motor_status:
|
||||
cmp [fdd_motor_status],0
|
||||
je end_check_fdd_motor_status_1
|
||||
mov eax,[timer_ticks]
|
||||
sub eax,[timer_fdd_motor]
|
||||
cmp eax,500
|
||||
jb end_check_fdd_motor_status
|
||||
call FDDMotorOFF
|
||||
mov [fdd_motor_status],0
|
||||
end_check_fdd_motor_status_1:
|
||||
mov [flp_status],0
|
||||
end_check_fdd_motor_status:
|
||||
ret
|
||||
|
||||
;**********************************
|
||||
;* ВЫКЛЮЧИТЬ МОТОР ДИСКОВОДА *
|
||||
;**********************************
|
||||
FDDMotorOFF:
|
||||
push AX
|
||||
push DX
|
||||
cmp [flp_number],1
|
||||
jne FDDMotorOFF_1
|
||||
call FDDMotorOFF_A
|
||||
jmp FDDMotorOFF_2
|
||||
FDDMotorOFF_1:
|
||||
call FDDMotorOFF_B
|
||||
FDDMotorOFF_2:
|
||||
pop DX
|
||||
pop AX
|
||||
; сброс флагов кеширования в связи с устареванием информации
|
||||
mov [root_read],0
|
||||
mov [flp_fat],0
|
||||
ret
|
||||
|
||||
FDDMotorOFF_A:
|
||||
mov DX,3F2h ;порт управления двигателями
|
||||
mov AL,0Ch ; Floppy A
|
||||
out DX,AL
|
||||
ret
|
||||
|
||||
FDDMotorOFF_B:
|
||||
mov DX,3F2h ;порт управления двигателями
|
||||
mov AL,5h ; Floppy B
|
||||
out DX,AL
|
||||
ret
|
||||
|
||||
;*******************************
|
||||
;* РЕКАЛИБРОВКА ДИСКОВОДА "A:" *
|
||||
;*******************************
|
||||
RecalibrateFDD:
|
||||
pusha
|
||||
call save_timer_fdd_motor
|
||||
; Подать команду "Рекалибровка"
|
||||
mov AL,07h
|
||||
call FDCDataOutput
|
||||
mov AL,00h
|
||||
call FDCDataOutput
|
||||
; Ожидать завершения операции
|
||||
call WaitFDCInterrupt
|
||||
; cmp [FDC_Status],0
|
||||
; je no_fdc_status_error
|
||||
; mov [flp_status],0
|
||||
;no_fdc_status_error:
|
||||
call save_timer_fdd_motor
|
||||
popa
|
||||
ret
|
||||
|
||||
;*****************************************************
|
||||
;* ПОИСК ДОРОЖКИ *
|
||||
;* Параметры передаются через глобальные переменные: *
|
||||
;* FDD_Track - номер дорожки (0-79); *
|
||||
;* FDD_Head - номер головки (0-1). *
|
||||
;* Результат операции заносится в FDC_Status. *
|
||||
;*****************************************************
|
||||
SeekTrack:
|
||||
pusha
|
||||
call save_timer_fdd_motor
|
||||
; Подать команду "Поиск"
|
||||
mov AL,0Fh
|
||||
call FDCDataOutput
|
||||
; Передать байт номера головки/накопител
|
||||
mov AL,[FDD_Head]
|
||||
shl AL,2
|
||||
call FDCDataOutput
|
||||
; Передать байт номера дорожки
|
||||
mov AL,[FDD_Track]
|
||||
call FDCDataOutput
|
||||
; Ожидать завершения операции
|
||||
call WaitFDCInterrupt
|
||||
cmp [FDC_Status],FDC_Normal
|
||||
jne @@Exit
|
||||
; Сохранить результат поиска
|
||||
mov AL,08h
|
||||
call FDCDataOutput
|
||||
call FDCDataInput
|
||||
mov [FDC_ST0],AL
|
||||
call FDCDataInput
|
||||
mov [FDC_C],AL
|
||||
; Проверить результат поиска
|
||||
; Поиск завершен?
|
||||
test [FDC_ST0],100000b
|
||||
je @@Err
|
||||
; Заданный трек найден?
|
||||
mov AL,[FDC_C]
|
||||
cmp AL,[FDD_Track]
|
||||
jne @@Err
|
||||
; Номер головки совпадает с заданным?
|
||||
mov AL,[FDC_ST0]
|
||||
and AL,100b
|
||||
shr AL,2
|
||||
cmp AL,[FDD_Head]
|
||||
jne @@Err
|
||||
; Операция завершена успешно
|
||||
mov [FDC_Status],FDC_Normal
|
||||
jmp @@Exit
|
||||
@@Err: ; Трек не найден
|
||||
mov [FDC_Status],FDC_TrackNotFound
|
||||
; mov [flp_status],0
|
||||
@@Exit:
|
||||
call save_timer_fdd_motor
|
||||
popa
|
||||
ret
|
||||
|
||||
;*******************************************************
|
||||
;* ЧТЕНИЕ СЕКТОРА ДАННЫХ *
|
||||
;* Параметры передаются через глобальные переменные: *
|
||||
;* FDD_Track - номер дорожки (0-79); *
|
||||
;* FDD_Head - номер головки (0-1); *
|
||||
;* FDD_Sector - номер сектора (1-18). *
|
||||
;* Результат операции заносится в FDC_Status. *
|
||||
;* В случае успешного выполнения операции чтения *
|
||||
;* содержимое сектора будет занесено в FDD_DataBuffer. *
|
||||
;*******************************************************
|
||||
ReadSector:
|
||||
pushad
|
||||
call save_timer_fdd_motor
|
||||
; Установить скорость передачи 500 Кбайт/с
|
||||
mov AX,0
|
||||
mov DX,03F7h
|
||||
out DX,AL
|
||||
; Инициализировать канал прямого доступа к памяти
|
||||
mov [dmamode],0x46
|
||||
call Init_FDC_DMA
|
||||
; Подать команду "Чтение данных"
|
||||
mov AL,0E6h ;чтение в мультитрековом режиме
|
||||
call FDCDataOutput
|
||||
mov AL,[FDD_Head]
|
||||
shl AL,2
|
||||
call FDCDataOutput
|
||||
mov AL,[FDD_Track]
|
||||
call FDCDataOutput
|
||||
mov AL,[FDD_Head]
|
||||
call FDCDataOutput
|
||||
mov AL,[FDD_Sector]
|
||||
call FDCDataOutput
|
||||
mov AL,2 ;код размера сектора (512 байт)
|
||||
call FDCDataOutput
|
||||
mov AL,18 ;+1; 3Fh ;число секторов на дорожке
|
||||
call FDCDataOutput
|
||||
mov AL,1Bh ;значение GPL
|
||||
call FDCDataOutput
|
||||
mov AL,0FFh ;значение DTL
|
||||
call FDCDataOutput
|
||||
; Ожидаем прерывание по завершении операции
|
||||
call WaitFDCInterrupt
|
||||
cmp [FDC_Status],FDC_Normal
|
||||
jne @@Exit_1
|
||||
; Считываем статус завершения операции
|
||||
call GetStatusInfo
|
||||
test [FDC_ST0],11011000b
|
||||
jnz @@Err_1
|
||||
mov [FDC_Status],FDC_Normal
|
||||
jmp @@Exit_1
|
||||
@@Err_1: mov [FDC_Status],FDC_SectorNotFound
|
||||
; mov [flp_status],0
|
||||
@@Exit_1:
|
||||
call save_timer_fdd_motor
|
||||
popad
|
||||
ret
|
||||
|
||||
;*******************************************************
|
||||
;* ЧТЕНИЕ СЕКТОРА (С ПОВТОРЕНИЕМ ОПЕРАЦИИ ПРИ СБОЕ) *
|
||||
;* Параметры передаются через глобальные переменные: *
|
||||
;* FDD_Track - номер дорожки (0-79); *
|
||||
;* FDD_Head - номер головки (0-1); *
|
||||
;* FDD_Sector - номер сектора (1-18). *
|
||||
;* Результат операции заносится в FDC_Status. *
|
||||
;* В случае успешного выполнения операции чтения *
|
||||
;* содержимое сектора будет занесено в FDD_DataBuffer. *
|
||||
;*******************************************************
|
||||
ReadSectWithRetr:
|
||||
pusha
|
||||
; Обнулить счетчик повторения операции рекалибровки
|
||||
mov [RecalRepCounter],0
|
||||
@@TryAgain:
|
||||
; Обнулить счетчик повторения операции чтени
|
||||
mov [ReadRepCounter],0
|
||||
@@ReadSector_1:
|
||||
call ReadSector
|
||||
cmp [FDC_Status],0
|
||||
je @@Exit_2
|
||||
cmp [FDC_Status],1
|
||||
je @@Err_3
|
||||
; Троекратное повторение чтени
|
||||
inc [ReadRepCounter]
|
||||
cmp [ReadRepCounter],3
|
||||
jb @@ReadSector_1
|
||||
; Троекратное повторение рекалибровки
|
||||
call RecalibrateFDD
|
||||
call SeekTrack
|
||||
inc [RecalRepCounter]
|
||||
cmp [RecalRepCounter],3
|
||||
jb @@TryAgain
|
||||
; mov [flp_status],0
|
||||
@@Exit_2:
|
||||
popa
|
||||
ret
|
||||
@@Err_3:
|
||||
mov [flp_status],0
|
||||
popa
|
||||
ret
|
||||
|
||||
;*******************************************************
|
||||
;* ЗАПИСЬ СЕКТОРА ДАННЫХ *
|
||||
;* Параметры передаются через глобальные переменные: *
|
||||
;* FDD_Track - номер дорожки (0-79); *
|
||||
;* FDD_Head - номер головки (0-1); *
|
||||
;* FDD_Sector - номер сектора (1-18). *
|
||||
;* Результат операции заносится в FDC_Status. *
|
||||
;* В случае успешного выполнения операции записи *
|
||||
;* содержимое FDD_DataBuffer будет занесено в сектор. *
|
||||
;*******************************************************
|
||||
WriteSector:
|
||||
pushad
|
||||
call save_timer_fdd_motor
|
||||
; Установить скорость передачи 500 Кбайт/с
|
||||
mov AX,0
|
||||
mov DX,03F7h
|
||||
out DX,AL
|
||||
; Инициализировать канал прямого доступа к памяти
|
||||
mov [dmamode],0x4A
|
||||
call Init_FDC_DMA
|
||||
; Подать команду "Запись данных"
|
||||
mov AL,0xC5 ;0x45 ;запись в мультитрековом режиме
|
||||
call FDCDataOutput
|
||||
mov AL,[FDD_Head]
|
||||
shl AL,2
|
||||
call FDCDataOutput
|
||||
mov AL,[FDD_Track]
|
||||
call FDCDataOutput
|
||||
mov AL,[FDD_Head]
|
||||
call FDCDataOutput
|
||||
mov AL,[FDD_Sector]
|
||||
call FDCDataOutput
|
||||
mov AL,2 ;код размера сектора (512 байт)
|
||||
call FDCDataOutput
|
||||
mov AL,18; 3Fh ;число секторов на дорожке
|
||||
call FDCDataOutput
|
||||
mov AL,1Bh ;значение GPL
|
||||
call FDCDataOutput
|
||||
mov AL,0FFh ;значение DTL
|
||||
call FDCDataOutput
|
||||
; Ожидаем прерывание по завершении операции
|
||||
call WaitFDCInterrupt
|
||||
cmp [FDC_Status],FDC_Normal
|
||||
jne @@Exit_3
|
||||
; Считываем статус завершения операции
|
||||
call GetStatusInfo
|
||||
test [FDC_ST0],11000000b ;11011000b
|
||||
jnz @@Err_2
|
||||
mov [FDC_Status],FDC_Normal
|
||||
jmp @@Exit_3
|
||||
@@Err_2: mov [FDC_Status],FDC_SectorNotFound
|
||||
@@Exit_3:
|
||||
call save_timer_fdd_motor
|
||||
popad
|
||||
ret
|
||||
|
||||
;*******************************************************
|
||||
;* ЗАПИСЬ СЕКТОРА (С ПОВТОРЕНИЕМ ОПЕРАЦИИ ПРИ СБОЕ) *
|
||||
;* Параметры передаются через глобальные переменные: *
|
||||
;* FDD_Track - номер дорожки (0-79); *
|
||||
;* FDD_Head - номер головки (0-1); *
|
||||
;* FDD_Sector - номер сектора (1-18). *
|
||||
;* Результат операции заносится в FDC_Status. *
|
||||
;* В случае успешного выполнения операции записи *
|
||||
;* содержимое FDD_DataBuffer будет занесено в сектор. *
|
||||
;*******************************************************
|
||||
WriteSectWithRetr:
|
||||
pusha
|
||||
; Обнулить счетчик повторения операции рекалибровки
|
||||
mov [RecalRepCounter],0
|
||||
@@TryAgain_1:
|
||||
; Обнулить счетчик повторения операции чтени
|
||||
mov [ReadRepCounter],0
|
||||
@@WriteSector_1:
|
||||
call WriteSector
|
||||
cmp [FDC_Status],0
|
||||
je @@Exit_4
|
||||
cmp [FDC_Status],1
|
||||
je @@Err_4
|
||||
; Троекратное повторение чтени
|
||||
inc [ReadRepCounter]
|
||||
cmp [ReadRepCounter],3
|
||||
jb @@WriteSector_1
|
||||
; Троекратное повторение рекалибровки
|
||||
call RecalibrateFDD
|
||||
call SeekTrack
|
||||
inc [RecalRepCounter]
|
||||
cmp [RecalRepCounter],3
|
||||
jb @@TryAgain_1
|
||||
@@Exit_4:
|
||||
popa
|
||||
ret
|
||||
@@Err_4:
|
||||
mov [flp_status],0
|
||||
popa
|
||||
ret
|
||||
|
||||
;*********************************************
|
||||
;* ПОЛУЧИТЬ ИНФОРМАЦИЮ О РЕЗУЛЬТАТЕ ОПЕРАЦИИ *
|
||||
;*********************************************
|
||||
GetStatusInfo:
|
||||
push AX
|
||||
call FDCDataInput
|
||||
mov [FDC_ST0],AL
|
||||
call FDCDataInput
|
||||
mov [FDC_ST1],AL
|
||||
call FDCDataInput
|
||||
mov [FDC_ST2],AL
|
||||
call FDCDataInput
|
||||
mov [FDC_C],AL
|
||||
call FDCDataInput
|
||||
mov [FDC_H],AL
|
||||
call FDCDataInput
|
||||
mov [FDC_R],AL
|
||||
call FDCDataInput
|
||||
mov [FDC_N],AL
|
||||
pop AX
|
||||
ret
|
||||
|
@ -1,871 +0,0 @@
|
||||
$Revision: 431 $
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
; Low-level driver for HDD access
|
||||
; DMA support by Mario79
|
||||
|
||||
;**************************************************************************
|
||||
;
|
||||
; 0x600008 - first entry in cache list
|
||||
;
|
||||
; +0 - lba sector
|
||||
; +4 - state of cache sector
|
||||
; 0 = empty
|
||||
; 1 = used for read ( same as in hd )
|
||||
; 2 = used for write ( differs from hd )
|
||||
;
|
||||
; +65536 - cache entries
|
||||
;
|
||||
;**************************************************************************
|
||||
|
||||
align 4
|
||||
hd_read:
|
||||
;-----------------------------------------------------------
|
||||
; input : eax = block to read
|
||||
; ebx = destination
|
||||
;-----------------------------------------------------------
|
||||
and [hd_error], 0
|
||||
push ecx esi edi ; scan cache
|
||||
|
||||
mov ecx,cache_max ; entries in cache
|
||||
mov esi,OS_BASE+0x600000+8
|
||||
mov edi,1
|
||||
|
||||
hdreadcache:
|
||||
|
||||
cmp dword [esi+4],0 ; empty
|
||||
je nohdcache
|
||||
|
||||
cmp [esi],eax ; correct sector
|
||||
je yeshdcache
|
||||
|
||||
nohdcache:
|
||||
|
||||
add esi,8
|
||||
inc edi
|
||||
dec ecx
|
||||
jnz hdreadcache
|
||||
|
||||
call find_empty_slot ; ret in edi
|
||||
cmp [hd_error],0
|
||||
jne return_01
|
||||
cmp [dma_hdd], 1
|
||||
jnz .nodma
|
||||
call hd_read_dma
|
||||
jmp @f
|
||||
.nodma:
|
||||
call hd_read_pio
|
||||
@@:
|
||||
|
||||
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
|
||||
|
||||
yeshdcache:
|
||||
|
||||
mov esi,edi
|
||||
shl esi,9
|
||||
add esi,OS_BASE+0x600000+65536
|
||||
mov edi,ebx
|
||||
mov ecx,512/4
|
||||
cld
|
||||
rep movsd ; move data
|
||||
return_01:
|
||||
pop edi esi ecx
|
||||
ret
|
||||
|
||||
align 4
|
||||
hd_read_pio:
|
||||
push eax edx
|
||||
|
||||
call wait_for_hd_idle
|
||||
cmp [hd_error],0
|
||||
jne hd_read_error
|
||||
|
||||
cli
|
||||
xor eax,eax
|
||||
mov edx,[hdbase]
|
||||
inc edx
|
||||
out dx,al ; ATAFeatures ॣ¨áâà "®á®¡¥®á⥩"
|
||||
inc edx
|
||||
inc eax
|
||||
out dx,al ; ATASectorCount áçñâ稪 ᥪâ®à®¢
|
||||
inc edx
|
||||
mov eax,[esp+4]
|
||||
out dx,al ; ATASectorNumber ॣ¨áâà ®¬¥à ᥪâ®à
|
||||
shr eax,8
|
||||
inc edx
|
||||
out dx,al ; ATACylinder ®¬¥à 樫¨¤à (¬« ¤è¨© ¡ ©â)
|
||||
shr eax,8
|
||||
inc edx
|
||||
out dx,al ; ®¬¥à 樫¨¤à (áâ à訩 ¡ ©â)
|
||||
shr eax,8
|
||||
inc edx
|
||||
and al,1+2+4+8
|
||||
add al,byte [hdid]
|
||||
add al,128+64+32
|
||||
out dx,al ; ®¬¥à £®«®¢ª¨/®¬¥à ¤¨áª
|
||||
inc edx
|
||||
mov al,20h
|
||||
out dx,al ; ATACommand ॣ¨áâà ª®¬ ¤
|
||||
sti
|
||||
|
||||
call wait_for_sector_buffer
|
||||
|
||||
cmp [hd_error],0
|
||||
jne hd_read_error
|
||||
|
||||
cli
|
||||
push edi
|
||||
shl edi,9
|
||||
add edi,OS_BASE+0x600000+65536
|
||||
mov ecx,256
|
||||
mov edx,[hdbase]
|
||||
cld
|
||||
rep insw
|
||||
pop edi
|
||||
sti
|
||||
|
||||
pop edx eax
|
||||
ret
|
||||
|
||||
disable_ide_int:
|
||||
; mov edx,[hdbase]
|
||||
; add edx,0x206
|
||||
; mov al,2
|
||||
; out dx,al
|
||||
cli
|
||||
ret
|
||||
|
||||
enable_ide_int:
|
||||
; mov edx,[hdbase]
|
||||
; add edx,0x206
|
||||
; mov al,0
|
||||
; out dx,al
|
||||
sti
|
||||
ret
|
||||
|
||||
align 4
|
||||
hd_write:
|
||||
;-----------------------------------------------------------
|
||||
; input : eax = block
|
||||
; ebx = pointer to memory
|
||||
;-----------------------------------------------------------
|
||||
push ecx esi edi
|
||||
|
||||
; check if the cache already has the sector and overwrite it
|
||||
|
||||
mov ecx,cache_max
|
||||
mov esi,OS_BASE+0x600000+8
|
||||
mov edi,1
|
||||
|
||||
hdwritecache:
|
||||
|
||||
cmp dword [esi+4],0 ; if cache slot is empty
|
||||
je not_in_cache_write
|
||||
|
||||
cmp [esi],eax ; if the slot has the sector
|
||||
je yes_in_cache_write
|
||||
|
||||
not_in_cache_write:
|
||||
|
||||
add esi,8
|
||||
inc edi
|
||||
dec ecx
|
||||
jnz hdwritecache
|
||||
|
||||
; sector not found in cache
|
||||
; write the block to a new location
|
||||
|
||||
call find_empty_slot ; ret in edi
|
||||
cmp [hd_error],0
|
||||
jne hd_write_access_denied
|
||||
|
||||
lea esi,[edi*8+OS_BASE+0x600000]
|
||||
mov [esi],eax ; sector number
|
||||
|
||||
yes_in_cache_write:
|
||||
|
||||
mov dword [esi+4],2 ; write - differs from hd
|
||||
|
||||
shl edi,9
|
||||
add edi,OS_BASE+0x600000+65536
|
||||
mov esi,ebx
|
||||
mov ecx,512/4
|
||||
cld
|
||||
rep movsd ; move data
|
||||
hd_write_access_denied:
|
||||
pop edi esi ecx
|
||||
ret
|
||||
|
||||
|
||||
write_cache:
|
||||
;-----------------------------------------------------------
|
||||
; write all changed sectors to disk
|
||||
;-----------------------------------------------------------
|
||||
push eax ecx edx esi edi
|
||||
|
||||
; write difference ( 2 ) from cache to hd
|
||||
|
||||
mov ecx,cache_max
|
||||
mov esi,OS_BASE+0x600000+8
|
||||
mov edi,1
|
||||
|
||||
write_cache_more:
|
||||
|
||||
cmp dword [esi+4],2 ; if cache slot is not different
|
||||
jne .write_chain
|
||||
|
||||
mov dword [esi+4],1 ; same as in hd
|
||||
mov eax,[esi] ; eax = sector to write
|
||||
|
||||
cmp eax,[PARTITION_START]
|
||||
jb danger
|
||||
cmp eax,[PARTITION_END]
|
||||
ja danger
|
||||
|
||||
cmp [allow_dma_write], 1
|
||||
jnz .nodma
|
||||
cmp [dma_hdd], 1
|
||||
jnz .nodma
|
||||
; Ž¡ê¥¤¨ï¥¬ § ¯¨áì 楯®çª¨ ¯®á«¥¤®¢ ⥫ìëå ᥪâ®à®¢ ¢ ®¤® ®¡à 饨¥ ª ¤¨áªã
|
||||
cmp ecx, 1
|
||||
jz .nonext
|
||||
cmp dword [esi+8+4], 2
|
||||
jnz .nonext
|
||||
push eax
|
||||
inc eax
|
||||
cmp eax, [esi+8]
|
||||
pop eax
|
||||
jnz .nonext
|
||||
cmp [cache_chain_started], 1
|
||||
jz @f
|
||||
mov [cache_chain_started], 1
|
||||
mov [cache_chain_size], 0
|
||||
mov [cache_chain_pos], edi
|
||||
mov [cache_chain_ptr], esi
|
||||
@@:
|
||||
inc [cache_chain_size]
|
||||
cmp [cache_chain_size], 64
|
||||
jnz .continue
|
||||
jmp .write_chain
|
||||
.nonext:
|
||||
call flush_cache_chain
|
||||
mov [cache_chain_size], 1
|
||||
mov [cache_chain_ptr], esi
|
||||
call write_cache_sector
|
||||
jmp .continue
|
||||
.nodma:
|
||||
call cache_write_pio
|
||||
.write_chain:
|
||||
call flush_cache_chain
|
||||
|
||||
.continue:
|
||||
danger:
|
||||
|
||||
add esi,8
|
||||
inc edi
|
||||
dec ecx
|
||||
jnz write_cache_more
|
||||
call flush_cache_chain
|
||||
return_02:
|
||||
pop edi esi edx ecx eax
|
||||
ret
|
||||
|
||||
flush_cache_chain:
|
||||
cmp [cache_chain_started], 0
|
||||
jz @f
|
||||
call write_cache_chain
|
||||
mov [cache_chain_started], 0
|
||||
@@:
|
||||
ret
|
||||
|
||||
align 4
|
||||
cache_write_pio:
|
||||
call disable_ide_int
|
||||
|
||||
call wait_for_hd_idle
|
||||
cmp [hd_error],0
|
||||
jne hd_write_error
|
||||
|
||||
; cli
|
||||
xor eax,eax
|
||||
mov edx,[hdbase]
|
||||
inc edx
|
||||
out dx,al
|
||||
inc edx
|
||||
inc eax
|
||||
out dx,al
|
||||
inc edx
|
||||
mov eax,[esi] ; eax = sector to write
|
||||
out dx,al
|
||||
shr eax,8
|
||||
inc edx
|
||||
out dx,al
|
||||
shr eax,8
|
||||
inc edx
|
||||
out dx,al
|
||||
shr eax,8
|
||||
inc edx
|
||||
and al,1+2+4+8
|
||||
add al,byte [hdid]
|
||||
add al,128+64+32
|
||||
out dx,al
|
||||
inc edx
|
||||
mov al,30h
|
||||
out dx,al
|
||||
; sti
|
||||
|
||||
call wait_for_sector_buffer
|
||||
|
||||
cmp [hd_error],0
|
||||
jne hd_write_error
|
||||
|
||||
push ecx esi
|
||||
|
||||
; cli
|
||||
mov esi,edi
|
||||
shl esi,9
|
||||
add esi,OS_BASE+0x600000+65536 ; esi = from memory position
|
||||
mov ecx,256
|
||||
mov edx,[hdbase]
|
||||
cld
|
||||
rep outsw
|
||||
; sti
|
||||
|
||||
call enable_ide_int
|
||||
pop esi ecx
|
||||
|
||||
ret
|
||||
|
||||
align 4
|
||||
find_empty_slot:
|
||||
;-----------------------------------------------------------
|
||||
; find empty or read slot, flush cache if next 10% is used by write
|
||||
; output : edi = cache slot
|
||||
;-----------------------------------------------------------
|
||||
; push ecx esi
|
||||
|
||||
search_again:
|
||||
|
||||
mov ecx,cache_max*10/100
|
||||
mov edi,[cache_search_start]
|
||||
|
||||
search_for_empty:
|
||||
|
||||
inc edi
|
||||
cmp edi,cache_max
|
||||
jbe inside_cache
|
||||
mov edi,1
|
||||
|
||||
inside_cache:
|
||||
|
||||
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
|
||||
|
||||
call write_cache ; no empty slots found, write all
|
||||
cmp [hd_error],0
|
||||
jne found_slot_access_denied
|
||||
|
||||
jmp search_again ; and start again
|
||||
|
||||
found_slot:
|
||||
|
||||
mov [cache_search_start],edi
|
||||
found_slot_access_denied:
|
||||
ret
|
||||
|
||||
align 4
|
||||
clear_hd_cache:
|
||||
|
||||
push eax ecx edi
|
||||
mov edi,OS_BASE+0x600000
|
||||
mov ecx,16384
|
||||
xor eax,eax
|
||||
cld
|
||||
rep stosd ; clear hd cache with 0
|
||||
mov [cache_search_start],eax
|
||||
mov [fat_in_cache],-1
|
||||
mov [fat_change],0
|
||||
pop edi ecx eax
|
||||
ret
|
||||
|
||||
save_hd_wait_timeout:
|
||||
|
||||
push eax
|
||||
mov eax,[timer_ticks];[0xfdf0]
|
||||
add eax,300 ; 3 sec timeout
|
||||
mov [hd_wait_timeout],eax
|
||||
pop eax
|
||||
ret
|
||||
|
||||
align 4
|
||||
check_hd_wait_timeout:
|
||||
|
||||
push eax
|
||||
mov eax,[hd_wait_timeout]
|
||||
cmp [timer_ticks], eax ;[0xfdf0],eax
|
||||
jg hd_timeout_error
|
||||
pop eax
|
||||
mov [hd_error],0
|
||||
ret
|
||||
|
||||
;iglobal
|
||||
; hd_timeout_str db 'K : FS - HD timeout',0
|
||||
; hd_read_str db 'K : FS - HD read error',0
|
||||
; hd_write_str db 'K : FS - HD write error',0
|
||||
; hd_lba_str db 'K : FS - HD LBA error',0
|
||||
;endg
|
||||
|
||||
hd_timeout_error:
|
||||
|
||||
; call clear_hd_cache
|
||||
; call clear_application_table_status
|
||||
; mov esi,hd_timeout_str
|
||||
; call sys_msg_board_str
|
||||
DEBUGF 1,"K : FS - HD timeout\n"
|
||||
; jmp $
|
||||
mov [hd_error],1
|
||||
pop eax
|
||||
ret
|
||||
|
||||
hd_read_error:
|
||||
|
||||
; call clear_hd_cache
|
||||
; call clear_application_table_status
|
||||
; mov esi,hd_read_str
|
||||
; call sys_msg_board_str
|
||||
DEBUGF 1,"K : FS - HD read error\n"
|
||||
pop edx eax
|
||||
ret
|
||||
|
||||
hd_write_error:
|
||||
|
||||
; call clear_hd_cache
|
||||
; call clear_application_table_status
|
||||
; mov esi,hd_write_str
|
||||
; call sys_msg_board_str
|
||||
DEBUGF 1,"K : FS - HD write error\n"
|
||||
ret
|
||||
|
||||
hd_write_error_dma:
|
||||
; call clear_hd_cache
|
||||
; call clear_application_table_status
|
||||
; mov esi, hd_write_str
|
||||
; call sys_msg_board_str
|
||||
DEBUGF 1,"K : FS - HD read error\n"
|
||||
pop esi
|
||||
ret
|
||||
|
||||
hd_lba_error:
|
||||
; call clear_hd_cache
|
||||
; call clear_application_table_status
|
||||
; mov esi,hd_lba_str
|
||||
; call sys_msg_board_str
|
||||
DEBUGF 1,"K : FS - HD LBA error\n"
|
||||
jmp LBA_read_ret
|
||||
|
||||
|
||||
align 4
|
||||
wait_for_hd_idle:
|
||||
|
||||
push eax edx
|
||||
|
||||
call save_hd_wait_timeout
|
||||
|
||||
mov edx,[hdbase]
|
||||
add edx,0x7
|
||||
|
||||
wfhil1:
|
||||
|
||||
call check_hd_wait_timeout
|
||||
cmp [hd_error],0
|
||||
jne @f
|
||||
|
||||
in al,dx
|
||||
test al,128
|
||||
jnz wfhil1
|
||||
|
||||
@@:
|
||||
|
||||
pop edx eax
|
||||
ret
|
||||
|
||||
|
||||
align 4
|
||||
wait_for_sector_buffer:
|
||||
|
||||
push eax edx
|
||||
|
||||
mov edx,[hdbase]
|
||||
add edx,0x7
|
||||
|
||||
call save_hd_wait_timeout
|
||||
|
||||
hdwait_sbuf: ; wait for sector buffer to be ready
|
||||
|
||||
call check_hd_wait_timeout
|
||||
cmp [hd_error],0
|
||||
jne @f
|
||||
|
||||
in al,dx
|
||||
test al,8
|
||||
jz hdwait_sbuf
|
||||
|
||||
mov [hd_error],0
|
||||
|
||||
cmp [hd_setup],1 ; do not mark error for setup request
|
||||
je buf_wait_ok
|
||||
|
||||
test al,1 ; previous command ended up with an error
|
||||
jz buf_wait_ok
|
||||
@@:
|
||||
mov [hd_error],1
|
||||
|
||||
buf_wait_ok:
|
||||
|
||||
pop edx eax
|
||||
ret
|
||||
|
||||
; \begin{Mario79}
|
||||
align 4
|
||||
wait_for_sector_dma_ide0:
|
||||
push eax
|
||||
push edx
|
||||
call save_hd_wait_timeout
|
||||
.wait:
|
||||
call change_task
|
||||
cmp [irq14_func], hdd_irq14
|
||||
jnz .done
|
||||
call check_hd_wait_timeout
|
||||
cmp [hd_error], 0
|
||||
jz .wait
|
||||
mov [irq14_func], hdd_irq_null
|
||||
mov dx, [IDEContrRegsBaseAddr]
|
||||
mov al, 0
|
||||
out dx, al
|
||||
.done:
|
||||
pop edx
|
||||
pop eax
|
||||
ret
|
||||
|
||||
align 4
|
||||
wait_for_sector_dma_ide1:
|
||||
push eax
|
||||
push edx
|
||||
call save_hd_wait_timeout
|
||||
.wait:
|
||||
call change_task
|
||||
cmp [irq15_func], hdd_irq15
|
||||
jnz .done
|
||||
call check_hd_wait_timeout
|
||||
cmp [hd_error], 0
|
||||
jz .wait
|
||||
mov [irq15_func], hdd_irq_null
|
||||
mov dx, [IDEContrRegsBaseAddr]
|
||||
add dx, 8
|
||||
mov al, 0
|
||||
out dx, al
|
||||
.done:
|
||||
pop edx
|
||||
pop eax
|
||||
ret
|
||||
|
||||
iglobal
|
||||
align 4
|
||||
; note that IDE descriptor table must be 4-byte aligned and do not cross 4K boundary
|
||||
IDE_descriptor_table:
|
||||
dd OS_BASE+284000h
|
||||
dw 2000h
|
||||
dw 8000h
|
||||
|
||||
dma_cur_sector dd not 40h
|
||||
irq14_func dd hdd_irq_null
|
||||
irq15_func dd hdd_irq_null
|
||||
endg
|
||||
|
||||
uglobal
|
||||
; all uglobals are zeroed at boot
|
||||
dma_process dd 0
|
||||
dma_slot_ptr dd 0
|
||||
cache_chain_pos dd 0
|
||||
cache_chain_ptr dd 0
|
||||
cache_chain_size db 0
|
||||
cache_chain_started db 0
|
||||
dma_task_switched db 0
|
||||
dma_hdd db 0
|
||||
allow_dma_write db 0
|
||||
endg
|
||||
|
||||
align 4
|
||||
hdd_irq14:
|
||||
pushfd
|
||||
cli
|
||||
pushad
|
||||
mov [irq14_func], hdd_irq_null
|
||||
mov dx, [IDEContrRegsBaseAddr]
|
||||
mov al, 0
|
||||
out dx, al
|
||||
call update_counters
|
||||
mov ebx, [dma_process]
|
||||
cmp [CURRENT_TASK], ebx
|
||||
jz .noswitch
|
||||
mov [dma_task_switched], 1
|
||||
mov edi, [dma_slot_ptr]
|
||||
mov eax, [CURRENT_TASK]
|
||||
mov [dma_process], eax
|
||||
mov eax, [TASK_BASE]
|
||||
mov [dma_slot_ptr], eax
|
||||
mov [CURRENT_TASK], ebx
|
||||
mov [TASK_BASE], edi
|
||||
mov byte [0xFFFF], 1
|
||||
call do_change_task
|
||||
.noswitch:
|
||||
popad
|
||||
popfd
|
||||
align 4
|
||||
hdd_irq_null:
|
||||
ret
|
||||
|
||||
align 4
|
||||
hdd_irq15:
|
||||
pushfd
|
||||
cli
|
||||
pushad
|
||||
mov [irq15_func], hdd_irq_null
|
||||
mov dx, [IDEContrRegsBaseAddr]
|
||||
add dx, 8
|
||||
mov al, 0
|
||||
out dx, al
|
||||
call update_counters
|
||||
mov ebx, [dma_process]
|
||||
cmp [CURRENT_TASK], ebx
|
||||
jz .noswitch
|
||||
mov [dma_task_switched], 1
|
||||
mov edi, [dma_slot_ptr]
|
||||
mov eax, [CURRENT_TASK]
|
||||
mov [dma_process], eax
|
||||
mov eax, [TASK_BASE]
|
||||
mov [dma_slot_ptr], eax
|
||||
mov [CURRENT_TASK], ebx
|
||||
mov [TASK_BASE], edi
|
||||
mov byte [0xFFFF], 1
|
||||
call do_change_task
|
||||
.noswitch:
|
||||
popad
|
||||
popfd
|
||||
ret
|
||||
|
||||
align 4
|
||||
hd_read_dma:
|
||||
push eax
|
||||
push edx
|
||||
mov edx, [dma_cur_sector]
|
||||
cmp eax, edx
|
||||
jb .notread
|
||||
add edx, 15
|
||||
cmp [esp+4], edx
|
||||
ja .notread
|
||||
mov eax, [esp+4]
|
||||
sub eax, [dma_cur_sector]
|
||||
shl eax, 9
|
||||
add eax, OS_BASE+0x284000
|
||||
push ecx esi edi
|
||||
mov esi, eax
|
||||
shl edi, 9
|
||||
add edi, OS_BASE+0x610000
|
||||
mov ecx, 512/4
|
||||
cld
|
||||
rep movsd
|
||||
pop edi esi ecx
|
||||
pop edx
|
||||
pop eax
|
||||
ret
|
||||
.notread:
|
||||
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
|
||||
add edx, 8
|
||||
@@:
|
||||
push edx
|
||||
add edx, 4
|
||||
out dx, eax
|
||||
pop edx
|
||||
mov al, 0
|
||||
out dx, al
|
||||
add edx, 2
|
||||
mov al, 6
|
||||
out dx, al
|
||||
call wait_for_hd_idle
|
||||
cmp [hd_error], 0
|
||||
jnz hd_read_error
|
||||
call disable_ide_int
|
||||
xor eax, eax
|
||||
mov edx, [hdbase]
|
||||
inc edx
|
||||
out dx, al
|
||||
inc edx
|
||||
mov eax, 10h
|
||||
out dx, al
|
||||
inc edx
|
||||
mov eax, [esp+4]
|
||||
out dx, al
|
||||
shr eax, 8
|
||||
inc edx
|
||||
out dx, al
|
||||
shr eax, 8
|
||||
inc edx
|
||||
out dx, al
|
||||
shr eax, 8
|
||||
inc edx
|
||||
and al, 0xF
|
||||
add al, byte [hdid]
|
||||
add al, 11100000b
|
||||
out dx, al
|
||||
inc edx
|
||||
mov al, 0xC8
|
||||
out dx, al
|
||||
mov dx, [IDEContrRegsBaseAddr]
|
||||
cmp [hdbase], 0x1F0
|
||||
jz @f
|
||||
add dx, 8
|
||||
@@:
|
||||
mov al, 9
|
||||
out dx, al
|
||||
mov eax, [CURRENT_TASK]
|
||||
mov [dma_process], eax
|
||||
mov eax, [TASK_BASE]
|
||||
mov [dma_slot_ptr], eax
|
||||
cmp [hdbase], 0x1F0
|
||||
jnz .ide1
|
||||
mov [irq14_func], hdd_irq14
|
||||
jmp @f
|
||||
.ide1:
|
||||
mov [irq15_func], hdd_irq15
|
||||
@@:
|
||||
call enable_ide_int
|
||||
cmp [hdbase], 0x1F0
|
||||
jnz .wait_ide1
|
||||
call wait_for_sector_dma_ide0
|
||||
jmp @f
|
||||
.wait_ide1:
|
||||
call wait_for_sector_dma_ide1
|
||||
@@:
|
||||
cmp [hd_error], 0
|
||||
jnz hd_read_error
|
||||
pop edx
|
||||
pop eax
|
||||
mov [dma_cur_sector], eax
|
||||
jmp hd_read_dma
|
||||
|
||||
align 4
|
||||
write_cache_chain:
|
||||
push esi
|
||||
mov eax, IDE_descriptor_table
|
||||
mov edx, [cache_chain_pos]
|
||||
shl edx, 9
|
||||
add edx, OS_BASE+0x610000
|
||||
mov [eax], edx
|
||||
movzx edx, [cache_chain_size]
|
||||
shl edx, 9
|
||||
mov [eax+4], dx
|
||||
jmp do_write_dma
|
||||
write_cache_sector:
|
||||
push esi
|
||||
mov eax, IDE_descriptor_table
|
||||
mov edx, edi
|
||||
shl edx, 9
|
||||
add edx, OS_BASE+0x610000
|
||||
mov [eax], edx
|
||||
mov word [eax+4], 0x200
|
||||
do_write_dma:
|
||||
mov dx, [IDEContrRegsBaseAddr]
|
||||
cmp [hdbase], 0x1F0
|
||||
jz @f
|
||||
add edx, 8
|
||||
@@:
|
||||
push edx
|
||||
add edx, 4
|
||||
out dx, eax
|
||||
pop edx
|
||||
mov al, 0
|
||||
out dx, al
|
||||
add edx, 2
|
||||
mov al, 6
|
||||
out dx, al
|
||||
call wait_for_hd_idle
|
||||
cmp [hd_error], 0
|
||||
jnz hd_write_error_dma
|
||||
call disable_ide_int
|
||||
xor eax, eax
|
||||
mov edx, [hdbase]
|
||||
inc edx
|
||||
out dx, al
|
||||
inc edx
|
||||
mov al, [cache_chain_size]
|
||||
out dx, al
|
||||
inc edx
|
||||
mov esi, [cache_chain_ptr]
|
||||
mov eax, [esi]
|
||||
out dx, al
|
||||
shr eax, 8
|
||||
inc edx
|
||||
out dx, al
|
||||
shr eax, 8
|
||||
inc edx
|
||||
out dx, al
|
||||
shr eax, 8
|
||||
inc edx
|
||||
and al, 0xF
|
||||
add al, byte [hdid]
|
||||
add al, 11100000b
|
||||
out dx, al
|
||||
inc edx
|
||||
mov al, 0xCA
|
||||
out dx, al
|
||||
mov dx, [IDEContrRegsBaseAddr]
|
||||
cmp [hdbase], 0x1F0
|
||||
jz @f
|
||||
add dx, 8
|
||||
@@:
|
||||
mov al, 1
|
||||
out dx, al
|
||||
mov eax, [CURRENT_TASK]
|
||||
mov [dma_process], eax
|
||||
mov eax, [TASK_BASE]
|
||||
mov [dma_slot_ptr], eax
|
||||
cmp [hdbase], 0x1F0
|
||||
jnz .ide1
|
||||
mov [irq14_func], hdd_irq14
|
||||
jmp @f
|
||||
.ide1:
|
||||
mov [irq15_func], hdd_irq15
|
||||
@@:
|
||||
call enable_ide_int
|
||||
mov [dma_cur_sector], not 0x40
|
||||
cmp [hdbase], 0x1F0
|
||||
jnz .wait_ide1
|
||||
call wait_for_sector_dma_ide0
|
||||
jmp @f
|
||||
.wait_ide1:
|
||||
call wait_for_sector_dma_ide1
|
||||
@@:
|
||||
cmp [hd_error], 0
|
||||
jnz hd_write_error_dma
|
||||
pop esi
|
||||
ret
|
||||
|
||||
uglobal
|
||||
IDEContrRegsBaseAddr dw ?
|
||||
endg
|
||||
; \end{Mario79}
|
File diff suppressed because it is too large
Load Diff
@ -1,30 +0,0 @@
|
||||
$Revision: 431 $
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
iglobal
|
||||
saverd_fileinfo:
|
||||
dd 2 ; subfunction: write
|
||||
dd 0 ; (reserved)
|
||||
dd 0 ; (reserved)
|
||||
dd 1440*1024 ; size 1440 Kb
|
||||
dd 0x100000 - std_application_base_address ; base address
|
||||
db 0
|
||||
.name:
|
||||
dd ?
|
||||
endg
|
||||
sysfn_saveramdisk: ; 18.6 = SAVE FLOPPY IMAGE (HD version only)
|
||||
call restorefatchain
|
||||
mov eax, saverd_fileinfo - std_application_base_address
|
||||
mov [saverd_fileinfo.name], ebx
|
||||
pushad
|
||||
push eax
|
||||
call file_system_lfn
|
||||
pop eax
|
||||
popad
|
||||
mov [esp+36], eax
|
||||
ret
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -1,94 +0,0 @@
|
||||
$Revision: 437 $
|
||||
;======================================================================
|
||||
;
|
||||
; BOOT DATA
|
||||
;
|
||||
;======================================================================
|
||||
|
||||
d80x25_bottom:
|
||||
db 186,' KolibriOS based on MenuetOS and comes with ABSOLUTELY '
|
||||
db 'NO WARRANTY ',186
|
||||
db 186,' See file COPYING for details '
|
||||
db ' ',186
|
||||
line_full_bottom
|
||||
d80x25_bottom_num = 3
|
||||
|
||||
novesa db "Display: EGA/CGA",13,10,0
|
||||
vervesa db "Version of Vesa: Vesa x.x",13,10,0
|
||||
vervesa_off=22
|
||||
msg_apm db " APM x.x ", 0
|
||||
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 "Bits Per Pixel: 24",13,10,0
|
||||
bt32 db "Bits Per Pixel: 32",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
|
||||
;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
|
||||
ask_dma db "Use DMA for HDD writing? [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 "Load ramdisk from [1-floppy; 2-C:\kolibri.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
|
||||
prnotfnd db "Fatal - Videomode not found.",0
|
||||
;modena db "Fatal - VBE 0x112+ required.",0
|
||||
not386 db "Fatal - CPU 386+ required.",0
|
||||
btns db "Fatal - Can't determine color depth.",0
|
||||
fatalsel db "Fatal - Graphics mode not supported by hardware.",0
|
||||
badsect db 13,10,186," Fatal - Bad sector. Replace floppy.",0
|
||||
memmovefailed db 13,10,186," Fatal - Int 0x15 move failed.",0
|
||||
okt db " ... OK"
|
||||
linef db 13,10,0
|
||||
diskload db "Loading diskette: 00 %",8,8,8,8,0
|
||||
pros db "00"
|
||||
backspace2 db 8,8,0
|
||||
boot_dev db 0 ; 0=floppy, 1=hd
|
||||
start_msg db "Press [abcd] to change settings, press [Enter] to continue booting",13,10,0
|
||||
time_msg db " or wait "
|
||||
time_str db " 5 seconds"
|
||||
db " before automatical continuation",13,10,0
|
||||
current_cfg_msg db "Current settings:",13,10,0
|
||||
curvideo_msg db " [a] Videomode: ",0
|
||||
mode1 db "640x480",0
|
||||
mode2 db "800x600",0
|
||||
mode3 db "1024x768",0
|
||||
mode4 db "1280x1024",0
|
||||
modes_msg dw mode4-0x10000,mode1-0x10000,mode2-0x10000,mode3-0x10000
|
||||
modevesa20 db " with LFB",0
|
||||
modevesa12 db ", VESA 1.2 Bnk",0
|
||||
mode9 db "320x200, EGA/CGA 256 colors",0
|
||||
mode10 db "640x480, VGA 16 colors",0
|
||||
probeno_msg db " (standard mode)",0
|
||||
probeok_msg db " (check nonstandard modes)",0
|
||||
dma_msg db " [b] Use DMA for HDD writing:",0
|
||||
on_msg db " on",13,10,0
|
||||
off_msg db " off",13,10,0
|
||||
vrrm_msg db " [c] Use VRR:",0
|
||||
preboot_device_msg db " [d] Floppy image: ",0
|
||||
preboot_device_msgs dw 0,pdm1-0x10000,pdm2-0x10000,pdm3-0x10000
|
||||
pdm1 db "real floppy",13,10,0
|
||||
pdm2 db "C:\kolibri.img (FAT32)",13,10,0
|
||||
pdm3 db "use already loaded image",13,10,0
|
||||
loading_msg db "Loading KolibriOS...",0
|
||||
save_quest db "Remember current settings? [y/n]: ",0
|
||||
loader_block_error db "Bootloader data invalid, I cannot continue. Stopped.",0
|
@ -1,94 +0,0 @@
|
||||
$Revision: 437 $
|
||||
;======================================================================
|
||||
;
|
||||
; BOOT DATA
|
||||
;
|
||||
;======================================================================
|
||||
|
||||
d80x25_bottom:
|
||||
db 186,' KolibriOS based on MenuetOS and comes with ABSOLUTELY '
|
||||
db 'NO WARRANTY ',186
|
||||
db 186,' See file COPYING for details '
|
||||
db ' ',186
|
||||
line_full_bottom
|
||||
d80x25_bottom_num = 3
|
||||
|
||||
novesa db "Ekraan: EGA/CGA",13,10,0
|
||||
vervesa db "Vesa versioon: Vesa x.x",13,10,0
|
||||
vervesa_off=20
|
||||
msg_apm db " APM x.x ", 0
|
||||
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 värvi: [9] 320x200, "
|
||||
db "VGA 16 värvi: [0] 640x480",13,10
|
||||
db 186," Vali reziim: ",0
|
||||
bt24 db "Bitti pikseli kohta: 24",13,10,0
|
||||
bt32 db "Bitti pikseli kohta: 32",13,10,0
|
||||
vrrmprint db "Kinnita VRR? (ekraani sagedus suurem kui 60Hz"
|
||||
db " ainult:",13,10
|
||||
db 186," 1024*768->800*600 ja 800*600->640*480) [1-jah,2-ei]:",0
|
||||
;askmouse db " Hiir:"
|
||||
; db " [1] PS/2 (USB), [2] Com1, [3] Com2."
|
||||
; db " Vali port [1-3]: ",0
|
||||
;no_com1 db 13,10,186, " No COM1 mouse",0
|
||||
;no_com2 db 13,10,186, " No COM2 mouse",0
|
||||
ask_dma db "Use DMA for HDD writing? [1-jah/2-ei]: ",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 "Paigalda mäluketas [1-diskett; 2-C:\kolibri.img (FAT32);"
|
||||
db 13,10,186," "
|
||||
db "3-kasuta eellaaditud mäluketast kerneli restardist]: ",0
|
||||
probetext db 13,10,13,10,186," Kasuta standartset graafika reziimi? [1-jah, "
|
||||
db "2-leia biosist (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 "Fataalne - Videoreziimi ei leitud.",0
|
||||
;modena db "Fataalne - VBE 0x112+ on vajalik.",0
|
||||
not386 db "Fataalne - CPU 386+ on vajalik.",0
|
||||
btns db "Fataalne - Ei suuda värvisügavust määratleda.",0
|
||||
fatalsel db "Fataalne - Graafilist reziimi riistvara ei toeta.",0
|
||||
badsect db 13,10,186," Fataalne - Vigane sektor. Asenda diskett.",0
|
||||
memmovefailed db 13,10,186," Fataalne - Int 0x15 liigutamine ebaõnnestus.",0
|
||||
okt db " ... OK"
|
||||
linef db 13,10,0
|
||||
diskload db "Loen disketti: 00 %",8,8,8,8,0
|
||||
pros db "00"
|
||||
backspace2 db 8,8,0
|
||||
boot_dev db 0 ; 0=floppy, 1=hd
|
||||
start_msg db "Vajuta [abcd] seadete muutmiseks, vajuta [Enter] laadimise jätkamiseks",13,10,0
|
||||
time_msg db " või oota "
|
||||
time_str db " 5 sekundit"
|
||||
db " automaatseks jätkamiseks",13,10,0
|
||||
current_cfg_msg db "Praegused seaded:",13,10,0
|
||||
curvideo_msg db " [a] Videoreziim: ",0
|
||||
mode1 db "640x480",0
|
||||
mode2 db "800x600",0
|
||||
mode3 db "1024x768",0
|
||||
mode4 db "1280x1024",0
|
||||
modes_msg dw mode4-0x10000,mode1-0x10000,mode2-0x10000,mode3-0x10000
|
||||
modevesa20 db " koos LFB",0
|
||||
modevesa12 db ", VESA 1.2 Bnk",0
|
||||
mode9 db "320x200, EGA/CGA 256 värvi",0
|
||||
mode10 db "640x480, VGA 16 värvi",0
|
||||
probeno_msg db " (standard reziim)",0
|
||||
probeok_msg db " (kontrolli ebastandardseid reziime)",0
|
||||
dma_msg db " [b] Use DMA for HDD writing:",0
|
||||
on_msg db " sees",13,10,0
|
||||
off_msg db " väljas",13,10,0
|
||||
vrrm_msg db " [c] Kasuta VRR:",0
|
||||
preboot_device_msg db " [d] Disketi kujutis: ",0
|
||||
preboot_device_msgs dw 0,pdm1-0x10000,pdm2-0x10000,pdm3-0x10000
|
||||
pdm1 db "reaalne diskett",13,10,0
|
||||
pdm2 db "C:\kolibri.img (FAT32)",13,10,0
|
||||
pdm3 db "kasuta juba laaditud kujutist",13,10,0
|
||||
loading_msg db "Laadin KolibriOS...",0
|
||||
save_quest db "Jäta meelde praegused seaded? [y/n]: ",0
|
||||
loader_block_error db "Alglaaduri andmed vigased, ei saa jätkata. Peatatud.",0
|
@ -1,99 +0,0 @@
|
||||
$Revision: 437 $
|
||||
;======================================================================
|
||||
;
|
||||
; BOOT DATA
|
||||
;
|
||||
;======================================================================
|
||||
|
||||
d80x25_bottom:
|
||||
; db 186,' KolibriOS based on MenuetOS and comes with ABSOLUTELY '
|
||||
; db 'NO WARRANTY ',186
|
||||
; db 186,' See file COPYING for details '
|
||||
; db ' ',186
|
||||
|
||||
db 186,' KolibriOS basiert auf MenuetOS und wird ohne jegliche '
|
||||
db ' Garantie vertrieben ',186
|
||||
db 186,' Details stehen in der Datei COPYING '
|
||||
db ' ',186
|
||||
line_full_bottom
|
||||
d80x25_bottom_num = 3
|
||||
|
||||
novesa db "Anzeige: EGA/CGA ",13,10,0
|
||||
vervesa db "Vesa-Version: Vesa ",13,10,0
|
||||
vervesa_off=22
|
||||
msg_apm db " APM x.x ", 0
|
||||
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 Farben: [9] 320x200, "
|
||||
db "VGA 16 Farben: [0] 640x480",13,10
|
||||
db 186," Waehle Modus: ",0
|
||||
bt24 db "Bits Per Pixel: 24",13,10,0
|
||||
bt32 db "Bits Per Pixel: 32",13,10,0
|
||||
vrrmprint db "VRR verwenden? (Monitorfrequenz groesser als 60Hz"
|
||||
db " only for transfers:",13,10
|
||||
db 186," 1024*768->800*600 und 800*600->640*480) [1-ja,2-nein]:",0
|
||||
;askmouse db " Maus angeschlossen an:"
|
||||
; db " [1] PS/2 (USB), [2] Com1, [3] Com2."
|
||||
; db " Waehle Port [1-3]: ",0
|
||||
;no_com1 db 13,10,186, " Keine COM1 Maus",0
|
||||
;no_com2 db 13,10,186, " Keine COM2 Maus",0
|
||||
ask_dma db "Nutze DMA zum HDD Aufschreiben? [1-ja/2-nein]: ",0
|
||||
;gr_direct db 186," Benutze direct LFB? "
|
||||
; db "[1-ja/2-nein] ? ",0
|
||||
;mem_model db 13,10,186," Hauptspeicher [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 "Lade die Ramdisk von [1-Diskette; 2-C:\kolibri.img (FAT32);"
|
||||
db 13,10,186," "
|
||||
db "3-benutze ein bereits geladenes Kernel image]: ",0
|
||||
probetext db 13,10,13,10,186," Nutze Standardgrafikmodi? [1-ja, "
|
||||
db "2-BIOS Test (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 "Fatal - Videomodus nicht gefunden.",0
|
||||
;modena db "Fatal - VBE 0x112+ required.",0
|
||||
not386 db "Fatal - CPU 386+ benoetigt.",0
|
||||
btns db "Fatal - konnte Farbtiefe nicht erkennen.",0
|
||||
fatalsel db "Fatal - Grafikmodus nicht unterstuetzt.",0
|
||||
badsect db 13,10,186," Fatal - Sektorfehler, Andere Diskette neutzen.",0
|
||||
memmovefailed db 13,10,186," Fatal - Int 0x15 Fehler.",0
|
||||
okt db " ... OK"
|
||||
linef db 13,10,0
|
||||
diskload db "Lade Diskette: 00 %",8,8,8,8,0
|
||||
pros db "00"
|
||||
backspace2 db 8,8,0
|
||||
boot_dev db 0 ; 0=floppy, 1=hd
|
||||
start_msg db "Druecke [abcd], um die Einstellungen zu aendern , druecke [Enter] zum starten",13,10,0
|
||||
time_msg db " oder warte "
|
||||
time_str db " 5 Sekunden"
|
||||
db " bis zum automatischen Start",13,10,0
|
||||
current_cfg_msg db "Aktuelle Einstellungen:",13,10,0
|
||||
curvideo_msg db " [a] Videomodus: ",0
|
||||
mode1 db "640x480",0
|
||||
mode2 db "800x600",0
|
||||
mode3 db "1024x768",0
|
||||
mode4 db "1280x1024",0
|
||||
modes_msg dw mode4-0x10000,mode1-0x10000,mode2-0x10000,mode3-0x10000
|
||||
modevesa20 db " mit LFB",0
|
||||
modevesa12 db ", VESA 1.2 Bnk",0
|
||||
mode9 db "320x200, EGA/CGA 256 colors",0
|
||||
mode10 db "640x480, VGA 16 colors",0
|
||||
probeno_msg db " (Standard Modus)",0
|
||||
probeok_msg db " (teste nicht-standard Modi)",0
|
||||
dma_msg db " [b] Nutze DMA zum HDD Aufschreiben:",0
|
||||
on_msg db " an",13,10,0
|
||||
off_msg db " aus",13,10,0
|
||||
vrrm_msg db " [c] Nutze VRR:",0
|
||||
preboot_device_msg db " [d] Diskettenimage: ",0
|
||||
preboot_device_msgs dw 0,pdm1-0x10000,pdm2-0x10000,pdm3-0x10000
|
||||
pdm1 db "Echte Diskette",13,10,0
|
||||
pdm2 db "C:\kolibri.img (FAT32)",13,10,0
|
||||
pdm3 db "Nutze bereits geladenes Image",13,10,0
|
||||
loading_msg db "Lade KolibriOS...",0
|
||||
save_quest db "Aktuelle Einstellungen speichern? [y/n]: ",0
|
||||
loader_block_error db "Bootloader Daten ungueltig, Kann nicht fortfahren. Angehalten.",0
|
@ -1,95 +0,0 @@
|
||||
$Revision: 437 $
|
||||
;======================================================================
|
||||
;
|
||||
; BOOT DATA
|
||||
;
|
||||
;======================================================================
|
||||
|
||||
d80x25_bottom:
|
||||
db 186,' Kolibri OS ®á®¢ Menuet OS ¨ ¥ ¯à¥¤®áâ ¢«ï¥â '
|
||||
db '¨ª ª¨å £ àa⨩. ',186
|
||||
db 186,' <20>®¤à®¡¥¥ ᬮâà¨â¥ ä ©« GNU.TXT '
|
||||
db ' ',186
|
||||
line_full_bottom
|
||||
d80x25_bottom_num = 3
|
||||
|
||||
novesa db "‚¨¤¥®ª àâ : EGA/CGA",13,10,0
|
||||
vervesa db "‚¥àá¨ï VESA: Vesa x.x",13,10,0
|
||||
vervesa_off=19
|
||||
msg_apm db " APM x.x ", 0
|
||||
|
||||
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
|
||||
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
|
||||
ask_dma db "ˆá¯®«ì§®¢ âì DMA ¤«ï § ¯¨á¨ HDD? [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," <20>à®á¬®âà¥âì ¦ãà « § £à㧪¨? [1-¥â/2-¤ ]: ",0
|
||||
bdev db "‡ £à㧨âì ®¡à § ¨§ [1-¤¨áª¥â ; 2-C:\kolibri.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
|
||||
btns db "Žè¨¡ª - <20>¥ ¬®£ã ®¯à¥¤¥«¨âì £«ã¡¨ã 梥â .",0
|
||||
fatalsel db "Žè¨¡ª - ‚ë¡à ë© ¢¨¤¥®à¥¦¨¬ ¥ ¯®¤¤¥à¦¨¢ ¥âáï.",0
|
||||
badsect db 13,10,186," Žè¨¡ª - „¨áª¥â ¯®¢à¥¦¤¥ . <20>®¯à®¡ã©â¥ ¤àã£ãî.",0
|
||||
memmovefailed db 13,10,186," Žè¨¡ª - Int 0x15 move failed.",0
|
||||
okt db " ... OK"
|
||||
linef db 13,10,0
|
||||
diskload db "‡ £à㧪 ¤¨áª¥âë: 00 %",8,8,8,8,0
|
||||
pros db "00"
|
||||
backspace2 db 8,8,0
|
||||
boot_dev db 0
|
||||
start_msg db "<EFBFBD> ¦¬¨â¥ [abcd] ¤«ï ¨§¬¥¥¨ï áâ஥ª, [Enter] ¤«ï ¯à®¤®«¦¥¨ï § £à㧪¨",13,10,0
|
||||
time_msg db " ¨«¨ ¯®¤®¦¤¨â¥ "
|
||||
time_str db " 5 ᥪ㤠"
|
||||
db " ¤® ¢â®¬ â¨ç¥áª®£® ¯à®¤®«¦¥¨ï",13,10,0
|
||||
current_cfg_msg db "’¥ªã騥 áâனª¨:",13,10,0
|
||||
curvideo_msg db " [a] ‚¨¤¥®à¥¦¨¬: ",0
|
||||
mode1 db "640x480",0
|
||||
mode2 db "800x600",0
|
||||
mode3 db "1024x768",0
|
||||
mode4 db "1280x1024",0
|
||||
modes_msg dw mode4-0x10000,mode1-0x10000,mode2-0x10000,mode3-0x10000
|
||||
modevesa20 db " á LFB",0
|
||||
modevesa12 db ", VESA 1.2 Bnk",0
|
||||
mode9 db "320x200, EGA/CGA 256 梥⮢",0
|
||||
mode10 db "640x480, VGA 16 梥⮢",0
|
||||
probeno_msg db " (áâ ¤ àâë© ¢¨¤¥®à¥¦¨¬)",0
|
||||
probeok_msg db " (¯à®¢¥à¨âì ¥áâ ¤ àâë¥ à¥¦¨¬ë)",0
|
||||
dma_msg db " [b] ˆá¯®«ì§®¢ ¨¥ DMA ¤«ï § ¯¨á¨ HDD:",0
|
||||
on_msg db " ¢ª«",13,10,0
|
||||
off_msg db " ¢ëª«",13,10,0
|
||||
vrrm_msg db " [c] ˆá¯®«ì§®¢ ¨¥ VRR:",0
|
||||
preboot_device_msg db " [d] Ž¡à § ¤¨áª¥âë: ",0
|
||||
preboot_device_msgs dw 0,pdm1-0x10000,pdm2-0x10000,pdm3-0x10000
|
||||
pdm1 db " áâ®ïé ï ¤¨áª¥â ",13,10,0
|
||||
pdm2 db "C:\kolibri.img (FAT32)",13,10,0
|
||||
pdm3 db "¨á¯®«ì§®¢ âì 㦥 § £àã¦¥ë© ®¡à §",13,10,0
|
||||
loading_msg db "ˆ¤ñâ § £à㧪 KolibriOS...",0
|
||||
save_quest db "‡ ¯®¬¨âì ⥪ã騥 áâனª¨? [y/n]: ",0
|
||||
loader_block_error db "Žè¨¡ª ¢ ¤ ëå ç «ì®£® § £àã§ç¨ª , ¯à®¤®«¦¥¨¥ ¥¢®§¬®¦®.",0
|
@ -1,52 +0,0 @@
|
||||
; boot data: common strings (for all languages)
|
||||
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_top:
|
||||
line_full_top
|
||||
cur_line_pos = 75
|
||||
store byte ' ' at d80x25_top+cur_line_pos+1
|
||||
rev_var = __REV__
|
||||
while rev_var > 0
|
||||
store byte rev_var mod 10 + '0' at d80x25_top+cur_line_pos
|
||||
cur_line_pos = cur_line_pos - 1
|
||||
rev_var = rev_var / 10
|
||||
end while
|
||||
store byte ' ' at d80x25_top+cur_line_pos
|
||||
store dword ' SVN' at d80x25_top+cur_line_pos-4
|
||||
|
||||
space_msg: line_space
|
||||
verstr:
|
||||
; line_space
|
||||
; version string
|
||||
db 186,32
|
||||
repeat 78
|
||||
load a byte from version+%-1
|
||||
if a = 13
|
||||
break
|
||||
end if
|
||||
db a
|
||||
end repeat
|
||||
repeat 78 - ($-verstr)
|
||||
db ' '
|
||||
end repeat
|
||||
db 32,186
|
||||
line_half
|
||||
d80x25_top_num = 4
|
@ -1,7 +0,0 @@
|
||||
$Revision: 425 $
|
||||
; Full ASCII code font
|
||||
; only õ and ä added
|
||||
; Kaitz
|
||||
ET_FNT:
|
||||
fontfile file "ETFONT.FNT"
|
||||
|
@ -1,34 +0,0 @@
|
||||
$Revision: 431 $
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
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 3 ; graph mode
|
||||
preboot_gprobe db 1 ; probe vesa3 videomodes (1-no, 2-yes)
|
||||
preboot_vrrm db 1 ; use VRR_M (1-yes, 2- no)
|
||||
preboot_dma_write db 2 ; use DMA for writing to HDD (1-yes, 2-no)
|
||||
preboot_device db 2 ; boot device
|
||||
; (1-floppy 2-harddisk 3-kernel restart)
|
||||
;!!!! 0 - autodetect !!!!
|
||||
preboot_blogesc db 1 ; start immediately after bootlog
|
||||
|
||||
if $>10200h
|
||||
ERROR: prebooting parameters must fit in first sector!!!
|
||||
end if
|
||||
hdsysimage db 'KOLIBRI IMG' ; load from
|
||||
image_save db 'KOLIBRI IMG' ; save to
|
||||
preboot_lfb db 0
|
||||
preboot_bootlog db 0
|
||||
|
@ -1,93 +0,0 @@
|
||||
$Revision: 425 $
|
||||
; 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
|
@ -1,545 +0,0 @@
|
||||
$Revision: 431 $
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;; Shutdown for Menuet ;;
|
||||
;; ;;
|
||||
;; Distributed under General Public License ;;
|
||||
;; See file COPYING for details. ;;
|
||||
;; Copyright 2003 Ville Turjanmaa ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
|
||||
system_shutdown: ; shut down the system
|
||||
call stop_all_services
|
||||
|
||||
push 3 ; stop playing cd
|
||||
pop eax
|
||||
call sys_cd_audio
|
||||
cld
|
||||
|
||||
mov al,[0x2f0000+0x9030]
|
||||
cmp al,1
|
||||
jl no_shutdown_parameter
|
||||
cmp al,4
|
||||
jle 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
|
||||
; push esi edi
|
||||
; sdnewpix:
|
||||
; lodsd
|
||||
; shr eax,1
|
||||
; and eax,0x7f7f7f7f
|
||||
; stosd
|
||||
; loop sdnewpix
|
||||
; pop ecx
|
||||
; pop esi edi
|
||||
; rep movsd
|
||||
; no_darken_screen:
|
||||
|
||||
; read shutdown code:
|
||||
; 1) display shutdown "window"
|
||||
|
||||
mov eax,[0xfe00]
|
||||
shr eax,1
|
||||
lea esi,[eax+220] ; x end
|
||||
sub eax,220 ; x start
|
||||
|
||||
mov ebx,[ScreenHeight]
|
||||
shr ebx,1
|
||||
mov [shutdownpos],ebx
|
||||
lea ebp,[ebx+105] ; y end
|
||||
sub ebx,120 ; y start
|
||||
|
||||
xor edi,edi
|
||||
inc edi ; force putpixel & dtext
|
||||
mov ecx,0x0000ff
|
||||
|
||||
; vertical loop begin
|
||||
sdnewpix1:
|
||||
push eax ; save x start
|
||||
|
||||
; horizontal loop begin
|
||||
sdnewpix2:
|
||||
|
||||
call [putpixel]
|
||||
|
||||
inc eax
|
||||
cmp eax,esi
|
||||
jnz sdnewpix2
|
||||
; horizontal loop end
|
||||
|
||||
dec ecx ; color
|
||||
pop eax ; restore x start
|
||||
|
||||
inc ebx ; advance y pos
|
||||
cmp ebx,ebp
|
||||
jnz sdnewpix1
|
||||
; vertical loop end
|
||||
|
||||
; 2) display text strings
|
||||
; a) version
|
||||
mov eax,[0xfe00]
|
||||
shr eax,1
|
||||
shl eax,16
|
||||
mov ax,word [shutdownpos]
|
||||
push eax
|
||||
sub eax,(220-27)*10000h + 105
|
||||
mov ebx,0xffff00
|
||||
mov ecx,version
|
||||
push 34
|
||||
pop edx
|
||||
call dtext
|
||||
|
||||
; b) variants
|
||||
add eax,105+33
|
||||
push 6
|
||||
pop esi
|
||||
; mov ebx,0xffffff
|
||||
mov bl,0xFF
|
||||
mov ecx,shutdowntext
|
||||
mov dl,40
|
||||
newsdt:
|
||||
call dtext
|
||||
add eax,10
|
||||
add ecx,edx
|
||||
dec esi
|
||||
jnz newsdt
|
||||
|
||||
; 3) load & display rose.txt
|
||||
mov eax,rosef-std_application_base_address ; load rose.txt
|
||||
xor ebx,ebx
|
||||
push 2
|
||||
pop ecx
|
||||
mov edx,0x90000
|
||||
push edx
|
||||
push 12
|
||||
pop esi
|
||||
push edi ; may be destroyed
|
||||
|
||||
pushad
|
||||
push eax
|
||||
call file_system_lfn ; by SPraid fileread
|
||||
pop eax
|
||||
popad
|
||||
pop edi
|
||||
|
||||
pop ecx
|
||||
inc ecx ; do not display stars from rose.txt
|
||||
pop eax
|
||||
add eax,20*10000h - 110
|
||||
|
||||
mov ebx,0x00ff00
|
||||
push 27
|
||||
pop edx
|
||||
|
||||
nrl:
|
||||
call dtext
|
||||
; sub ebx,0x050000
|
||||
ror ebx, 16
|
||||
sub bl, 0x05
|
||||
ror ebx, 16
|
||||
add eax,8
|
||||
add ecx,31
|
||||
cmp cx,word 0x0001+25*31
|
||||
jnz nrl
|
||||
|
||||
call checkVga_N13
|
||||
|
||||
yes_shutdown_param:
|
||||
cli
|
||||
|
||||
mov eax,kernel ; load kernel.mnt to 0x8000:0
|
||||
push 12
|
||||
pop esi
|
||||
xor ebx,ebx
|
||||
or ecx,-1
|
||||
mov edx,0x80000
|
||||
call fileread
|
||||
|
||||
mov esi,restart_kernel_4000+0x10000 ; move kernel re-starter to 0x4000:0
|
||||
mov edi,0x40000
|
||||
mov ecx,1000
|
||||
rep movsb
|
||||
|
||||
mov eax,0x2F0000 ; restore 0x0 - 0xffff
|
||||
xor ebx,ebx
|
||||
mov ecx,0x10000
|
||||
call memmove
|
||||
|
||||
call restorefatchain
|
||||
|
||||
mov al, 0xFF
|
||||
out 0x21, al
|
||||
out 0xA1, al
|
||||
|
||||
mov word [0x467+0],pr_mode_exit-0x10000
|
||||
mov word [0x467+2],0x1000
|
||||
|
||||
mov al,0x0F
|
||||
out 0x70,al
|
||||
mov al,0x05
|
||||
out 0x71,al
|
||||
|
||||
mov al,0xFE
|
||||
out 0x64,al
|
||||
hlt
|
||||
|
||||
use16
|
||||
|
||||
pr_mode_exit:
|
||||
org $-0x10000
|
||||
|
||||
; setup stack
|
||||
mov ax, 3000h
|
||||
mov ss, ax
|
||||
mov esp, 0EC00h
|
||||
; setup ds
|
||||
push cs
|
||||
pop ds
|
||||
|
||||
lidt [old_ints_h-0x10000]
|
||||
;remap IRQs
|
||||
mov al,0x11
|
||||
out 0x20,al
|
||||
call rdelay
|
||||
out 0xA0,al
|
||||
call rdelay
|
||||
|
||||
mov al,0x08
|
||||
out 0x21,al
|
||||
call rdelay
|
||||
mov al,0x70
|
||||
out 0xA1,al
|
||||
call rdelay
|
||||
|
||||
mov al,0x04
|
||||
out 0x21,al
|
||||
call rdelay
|
||||
mov al,0x02
|
||||
out 0xA1,al
|
||||
call rdelay
|
||||
|
||||
mov al,0x01
|
||||
out 0x21,al
|
||||
call rdelay
|
||||
out 0xA1,al
|
||||
call rdelay
|
||||
|
||||
mov al,0xB8
|
||||
out 0x21,al
|
||||
call rdelay
|
||||
mov al,0xBD
|
||||
out 0xA1,al
|
||||
sti
|
||||
|
||||
temp_3456:
|
||||
xor ax,ax
|
||||
mov es,ax
|
||||
mov al,byte [es:0x9030]
|
||||
cmp al,1
|
||||
jl nbw
|
||||
cmp al,4
|
||||
jle nbw32
|
||||
|
||||
nbw:
|
||||
in al,0x60
|
||||
call pause_key
|
||||
cmp al,6
|
||||
jae 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 ax
|
||||
jmp nbw32
|
||||
nbw31:
|
||||
add bl,128
|
||||
cmp al,bl
|
||||
jne nbw
|
||||
sub al,129
|
||||
|
||||
nbw32:
|
||||
|
||||
dec ax ; 1 = write floppy
|
||||
js nbw
|
||||
jnz no_floppy_write
|
||||
call floppy_write
|
||||
jmp temp_3456 ;nbw
|
||||
no_floppy_write:
|
||||
|
||||
dec ax ; 2 = power off
|
||||
jnz no_apm_off
|
||||
call APM_PowerOff
|
||||
jmp $
|
||||
no_apm_off:
|
||||
|
||||
dec ax ; 3 = reboot
|
||||
jnz restart_kernel ; 4 = restart kernel
|
||||
push 0x40
|
||||
pop ds
|
||||
mov word[0x0072],0x1234
|
||||
jmp 0xF000:0xFFF0
|
||||
|
||||
pause_key:
|
||||
mov cx,100
|
||||
pause_key_1:
|
||||
loop pause_key_1
|
||||
ret
|
||||
|
||||
rdelay:
|
||||
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:
|
||||
cli
|
||||
|
||||
; 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
|
||||
push ds
|
||||
pop es
|
||||
mov cx, 0x8000
|
||||
push cx
|
||||
mov ds, cx
|
||||
xor si, si
|
||||
xor di, di
|
||||
rep movsw
|
||||
push 0x9000
|
||||
pop ds
|
||||
push 0x2000
|
||||
pop es
|
||||
pop cx
|
||||
rep movsw
|
||||
|
||||
wbinvd ; write and invalidate cache
|
||||
|
||||
; mov ax,0x1000
|
||||
; mov es,ax
|
||||
; mov ax,0x3000
|
||||
; mov ss,ax
|
||||
; mov sp,0xec00
|
||||
; restore timer
|
||||
mov al, 00110100b
|
||||
out 43h, al
|
||||
jcxz $+2
|
||||
mov al, 0xFF
|
||||
out 40h, al
|
||||
jcxz $+2
|
||||
out 40h, al
|
||||
jcxz $+2
|
||||
sti
|
||||
|
||||
; (hint by Black_mirror)
|
||||
; We must read data from keyboard port,
|
||||
; because there may be situation when previous keyboard interrupt is lost
|
||||
; (due to return to real mode and IRQ reprogramming)
|
||||
; and next interrupt will not be generated (as keyboard waits for handling)
|
||||
in al, 0x60
|
||||
|
||||
; bootloader interface
|
||||
push 0x1000
|
||||
pop ds
|
||||
mov si, kernel_restart_bootblock-0x10000
|
||||
mov ax, 'KL'
|
||||
jmp 0x1000:0000
|
||||
|
||||
APM_PowerOff:
|
||||
mov ax, 5304h
|
||||
xor bx, bx
|
||||
int 15h
|
||||
;!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
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
|
||||
;!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
fwwritedone:
|
||||
ret
|
||||
org $+0x10000
|
||||
flm db 0
|
||||
org $-0x10000
|
||||
|
||||
floppy_write: ; write diskette image to physical floppy
|
||||
|
||||
cmp [flm-0x10000],byte 1
|
||||
je fwwritedone
|
||||
mov [flm-0x10000],byte 1
|
||||
|
||||
xor ax, ax ; reset drive
|
||||
xor dx, dx
|
||||
int 0x13
|
||||
|
||||
mov cx,0x0001 ; startcyl,startsector
|
||||
; mov dx,0x0000 ; starthead,drive
|
||||
xor dx, dx
|
||||
mov ax, 80*2 ; read no of sect
|
||||
|
||||
fwwrites:
|
||||
push ax
|
||||
|
||||
; move 1mb+ -> 0:a000
|
||||
|
||||
pusha
|
||||
mov si,fwmovedesc -0x10000
|
||||
mov cx,256*18
|
||||
mov ah,0x87
|
||||
push ds
|
||||
pop es
|
||||
int 0x15
|
||||
add dword [fwmovedesc-0x10000+0x12], 512*18
|
||||
popa
|
||||
|
||||
xor si,si
|
||||
mov es,si
|
||||
fwnewwrite:
|
||||
mov bx,0xa000 ; es:bx -> data area
|
||||
mov ax,0x0300+18 ; read, no of sectors to read
|
||||
int 0x13
|
||||
|
||||
test ah, ah
|
||||
jz fwgoodwrite
|
||||
|
||||
inc si
|
||||
cmp si,10
|
||||
jnz fwnewwrite
|
||||
|
||||
; can't access diskette - return
|
||||
pop ax
|
||||
ret
|
||||
|
||||
fwgoodwrite:
|
||||
inc dh
|
||||
cmp dh,2
|
||||
jnz fwbb2
|
||||
mov dh,0
|
||||
inc ch
|
||||
fwbb2:
|
||||
pop ax
|
||||
dec ax
|
||||
jnz fwwrites
|
||||
ret
|
||||
org $+0x10000
|
||||
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
|
||||
org $-0x10000
|
||||
use32
|
||||
org $+0x10000
|
||||
uglobal
|
||||
shutdownpos dd 0x0
|
||||
endg
|
||||
|
||||
iglobal
|
||||
if lang eq en
|
||||
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 '
|
||||
else if lang eq ru
|
||||
shutdowntext:
|
||||
db "<EFBFBD>¥§®¯ ᮥ ¢ëª«î票¥ ª®¬¯ìîâ¥à ¨«¨ "
|
||||
db ' '
|
||||
db '1) ‘®åà ¨âì à ¬¤¨áª ¤¨áª¥âã '
|
||||
db '2) APM - ¢ëª«î票¥ ¯¨â ¨ï '
|
||||
db '3) <20>¥à¥§ £à㧪 á¨á⥬ë '
|
||||
db '4) <20>¥áâ àâ ï¤à ¨§ Ž‡“ '
|
||||
else
|
||||
shutdowntext:
|
||||
db "SIE KOENNEN DEN COMPUTER NUN AUSSCHALTEN"
|
||||
db ' '
|
||||
db '1) RAMDISK AUF DISK SPEICHERN '
|
||||
db '2) APM - AUSSCHALTEN '
|
||||
db '3) NEUSTARTEN '
|
||||
db '4) KERNEL NEU STARTEN '
|
||||
end if
|
||||
rosef:
|
||||
dd 0,0,0,1024,0x90000-std_application_base_address
|
||||
db '/rd/1/ROSE.TXT',0
|
||||
endg
|
@ -1,31 +0,0 @@
|
||||
boot_log:
|
||||
pushad
|
||||
|
||||
mov eax,10*65536
|
||||
mov ax,word [boot_y]
|
||||
add [boot_y],dword 10
|
||||
mov ebx,0x80ffffff ; ASCIIZ string with white color
|
||||
mov ecx,esi
|
||||
mov edi,1
|
||||
call dtext
|
||||
|
||||
mov [novesachecksum],1000
|
||||
call checkVga_N13
|
||||
|
||||
cmp [preboot_blogesc],byte 1
|
||||
je .bll2
|
||||
|
||||
cmp esi,boot_tasking
|
||||
jne .bll2
|
||||
; begin ealex 04.08.05
|
||||
; in al,0x61
|
||||
; and al,01111111b
|
||||
; out 0x61,al
|
||||
; end ealex 04.08.05
|
||||
.bll1: in al,0x60 ; wait for ESC key press
|
||||
cmp al,129
|
||||
jne .bll1
|
||||
|
||||
.bll2: popad
|
||||
|
||||
ret
|
@ -1,25 +0,0 @@
|
||||
iglobal
|
||||
boot_memdetect db 'Determining amount of memory',0
|
||||
boot_fonts db 'Fonts loaded',0
|
||||
boot_tss db 'Setting TSSs',0
|
||||
boot_cpuid db 'Reading CPUIDs',0
|
||||
boot_devices db 'Detecting devices',0
|
||||
boot_timer db 'Setting timer',0
|
||||
boot_irqs db 'Reprogramming IRQs',0
|
||||
boot_setmouse db 'Setting mouse',0
|
||||
boot_windefs db 'Setting window defaults',0
|
||||
boot_bgr db 'Calculating background',0
|
||||
boot_resirqports db 'Reserving IRQs & ports',0
|
||||
boot_setrports db 'Setting addresses for IRQs',0
|
||||
boot_setostask db 'Setting OS task',0
|
||||
boot_allirqs db 'Unmasking all IRQs',0
|
||||
boot_tsc db 'Reading TSC',0
|
||||
boot_pal_ega db 'Setting EGA/CGA 320x200 palette',0
|
||||
boot_pal_vga db 'Setting VGA 640x480 palette',0
|
||||
boot_mtrr db 'Setting MTRR',0
|
||||
boot_tasking db 'All set - press ESC to start',0
|
||||
endg
|
||||
|
||||
iglobal
|
||||
boot_y dd 10
|
||||
endg
|
@ -1,582 +0,0 @@
|
||||
align 4
|
||||
|
||||
B32:
|
||||
; CLEAR 0x280000-0xF00000
|
||||
|
||||
xor eax,eax
|
||||
mov edi,0x280000
|
||||
mov ecx,(0x100000*0xF-0x280000) / 4
|
||||
cld
|
||||
rep stosd
|
||||
; CLEAR 0x80000-0x90000
|
||||
; xor eax,eax
|
||||
|
||||
mov edi,0x80000
|
||||
mov ecx,(0x90000-0x80000)/4
|
||||
; cld
|
||||
rep stosd
|
||||
|
||||
; CLEAR KERNEL UNDEFINED GLOBALS
|
||||
mov edi, endofcode
|
||||
mov ecx, (uglobals_size/4)+4
|
||||
rep stosd
|
||||
|
||||
; SAVE & CLEAR 0-0xffff
|
||||
|
||||
mov esi,0x0000
|
||||
mov edi,0x2F0000
|
||||
mov ecx,0x10000 / 4
|
||||
cld
|
||||
rep movsd
|
||||
xor eax,eax
|
||||
mov edi,0
|
||||
mov ecx,0x10000 / 4
|
||||
cld
|
||||
rep stosd
|
||||
|
||||
; SAVE REAL MODE VARIABLES
|
||||
mov ax, [0x2f0000 + 0x9031]
|
||||
mov [IDEContrRegsBaseAddr], ax
|
||||
; --------------- APM ---------------------
|
||||
mov eax, [0x2f0000 + 0x9040] ; entry point
|
||||
mov dword[apm_entry], eax
|
||||
mov word [apm_entry + 4], apm_code_32 - gdts
|
||||
|
||||
mov eax, [0x2f0000 + 0x9044] ; version & flags
|
||||
mov [apm_vf], eax
|
||||
; -----------------------------------------
|
||||
; movzx eax,byte [0x2f0000+0x9010] ; mouse port
|
||||
; mov [0xF604],byte 1 ;al
|
||||
mov al, [0x2F0000+0x901F] ; DMA writing
|
||||
mov [allow_dma_write], al
|
||||
mov al,[0x2f0000+0x9000] ; bpp
|
||||
mov [ScreenBPP],al
|
||||
movzx eax,word [0x2f0000+0x900A] ; X max
|
||||
dec eax
|
||||
mov [ScreenWidth],eax
|
||||
mov [screen_workarea.right],eax
|
||||
movzx eax,word [0x2f0000+0x900C] ; Y max
|
||||
dec eax
|
||||
mov [ScreenHeight],eax
|
||||
mov [screen_workarea.bottom],eax
|
||||
movzx eax,word [0x2f0000+0x9008] ; screen mode
|
||||
mov [SCR_MODE],eax
|
||||
mov eax,[0x2f0000+0x9014] ; Vesa 1.2 bnk sw add
|
||||
mov [BANK_SWITCH],eax
|
||||
mov [BytesPerScanLine],word 640*4 ; Bytes PerScanLine
|
||||
cmp [SCR_MODE],word 0x13 ; 320x200
|
||||
je @f
|
||||
cmp [SCR_MODE],word 0x12 ; VGA 640x480
|
||||
je @f
|
||||
mov ax,[0x2f0000+0x9001] ; for other modes
|
||||
mov [BytesPerScanLine],ax
|
||||
@@:
|
||||
|
||||
; GRAPHICS ADDRESSES
|
||||
|
||||
;mov eax,0x100000*8 ; LFB address
|
||||
;cmp [0xfe0c],word 0x13
|
||||
;je no_d_lfb
|
||||
;cmp [0xfe0c],word 0x12
|
||||
;je no_d_lfb
|
||||
;cmp [0x2f0000+0x901e],byte 1
|
||||
;jne no_d_lfb
|
||||
mov byte [0x2f0000+0x901e],0x0
|
||||
mov eax,[0x2f0000+0x9018]
|
||||
;no_d_lfb:
|
||||
mov [LFBAddress],eax
|
||||
|
||||
cmp [SCR_MODE],word 0100000000000000b
|
||||
jge setvesa20
|
||||
cmp [SCR_MODE],word 0x13
|
||||
je v20ga32
|
||||
mov [PUTPIXEL],dword Vesa12_putpixel24 ; Vesa 1.2
|
||||
mov [0xe024],dword Vesa12_getpixel24
|
||||
cmp [ScreenBPP],byte 24
|
||||
jz ga24
|
||||
mov [PUTPIXEL],dword Vesa12_putpixel32
|
||||
mov [0xe024],dword Vesa12_getpixel32
|
||||
ga24:
|
||||
jmp v20ga24
|
||||
setvesa20:
|
||||
mov [PUTPIXEL],dword Vesa20_putpixel24 ; Vesa 2.0
|
||||
mov [0xe024],dword Vesa20_getpixel24
|
||||
cmp [ScreenBPP],byte 24
|
||||
jz v20ga24
|
||||
v20ga32:
|
||||
mov [PUTPIXEL],dword Vesa20_putpixel32
|
||||
mov [0xe024],dword Vesa20_getpixel32
|
||||
v20ga24:
|
||||
cmp [SCR_MODE],word 0x12 ; 16 C VGA 640x480
|
||||
jne no_mode_0x12
|
||||
mov [PUTPIXEL],dword VGA_putpixel
|
||||
mov [0xe024],dword Vesa20_getpixel32
|
||||
no_mode_0x12:
|
||||
|
||||
call test_cpu
|
||||
; btr [cpu_caps], CAPS_SSE ;test: dont't use sse code
|
||||
; btr [cpu_caps], CAPS_SSE2 ;test: don't use sse2
|
||||
|
||||
; btr [cpu_caps], CAPS_FXSR ;test: disable sse support
|
||||
;all sse commands rise #UD exption
|
||||
; btr [cpu_caps], CAPS_PSE ;test: don't use large pages
|
||||
; btr [cpu_caps], CAPS_PGE ;test: don't use global pages
|
||||
; btr [cpu_caps], CAPS_MTRR ;test: don't use MTRR
|
||||
bts [cpu_caps], CAPS_TSC ;force use rdtsc
|
||||
|
||||
; -------- Fast System Call init ----------
|
||||
; Intel SYSENTER/SYSEXIT (AMD CPU support it too)
|
||||
bt [cpu_caps], CAPS_SEP
|
||||
jnc .SEnP ; SysEnter not Present
|
||||
xor edx, edx
|
||||
mov ecx, MSR_SYSENTER_CS
|
||||
mov eax, os_code
|
||||
wrmsr
|
||||
mov ecx, MSR_SYSENTER_ESP
|
||||
; mov eax, sysenter_stack ; Check it
|
||||
xor eax, eax
|
||||
wrmsr
|
||||
mov ecx, MSR_SYSENTER_EIP
|
||||
mov eax, sysenter_entry
|
||||
wrmsr
|
||||
.SEnP:
|
||||
; AMD SYSCALL/SYSRET
|
||||
cmp byte[cpu_vendor], 'A'
|
||||
jne .noSYSCALL
|
||||
mov eax, 0x80000001
|
||||
cpuid
|
||||
test edx, 0x800 ; bit_11 - SYSCALL/SYSRET support
|
||||
jz .noSYSCALL
|
||||
mov ecx, MSR_AMD_EFER
|
||||
rdmsr
|
||||
or eax, 1 ; bit_0 - System Call Extension (SCE)
|
||||
wrmsr
|
||||
|
||||
; !!!! It`s dirty hack, fix it !!!
|
||||
; Bits of EDX :
|
||||
; Bit 31–16 During the SYSRET instruction, this field is copied into the CS register
|
||||
; and the contents of this field, plus 8, are copied into the SS register.
|
||||
; Bit 15–0 During the SYSCALL instruction, this field is copied into the CS register
|
||||
; and the contents of this field, plus 8, are copied into the SS register.
|
||||
|
||||
; mov edx, (os_code + 16) * 65536 + os_code
|
||||
mov edx, 0x1B0013
|
||||
|
||||
mov eax, syscall_entry
|
||||
mov ecx, MSR_AMD_STAR
|
||||
wrmsr
|
||||
.noSYSCALL:
|
||||
; -----------------------------------------
|
||||
|
||||
|
||||
|
||||
; MEMORY MODEL
|
||||
call mem_test
|
||||
call init_mtrr
|
||||
call init_mem
|
||||
call init_page_map
|
||||
|
||||
; ENABLE PAGING
|
||||
mov eax, sys_pgdir
|
||||
mov cr3, eax
|
||||
|
||||
mov eax,cr0
|
||||
or eax,CR0_PG
|
||||
mov cr0,eax
|
||||
|
||||
call init_kernel_heap
|
||||
stdcall kernel_alloc, RING0_STACK_SIZE+512
|
||||
mov [os_stack], eax
|
||||
|
||||
call init_LFB
|
||||
call init_fpu
|
||||
|
||||
call init_malloc
|
||||
|
||||
stdcall alloc_kernel_space, 0x4F000
|
||||
mov [ipc_tmp], eax
|
||||
mov ebx, 0x1000
|
||||
|
||||
add eax, 0x40000
|
||||
mov [proc_mem_map], eax
|
||||
|
||||
add eax, 0x8000
|
||||
mov [proc_mem_pdir], eax
|
||||
|
||||
add eax, ebx
|
||||
mov [proc_mem_tab], eax
|
||||
|
||||
add eax, ebx
|
||||
mov [tmp_task_pdir], eax
|
||||
|
||||
add eax, ebx
|
||||
mov [tmp_task_ptab], eax
|
||||
|
||||
add eax, ebx
|
||||
mov [ipc_pdir], eax
|
||||
|
||||
add eax, ebx
|
||||
mov [ipc_ptab], eax
|
||||
|
||||
call init_events
|
||||
|
||||
mov eax, srv.fd-SRV_FD_OFFSET
|
||||
mov [srv.fd], eax
|
||||
mov [srv.bk], eax
|
||||
|
||||
mov edi, irq_tab
|
||||
xor eax, eax
|
||||
mov ecx, 16
|
||||
rep stosd
|
||||
|
||||
;Set base of graphic segment to linear address of LFB
|
||||
mov eax,[LFBAddress] ; set for gs
|
||||
mov [graph_data_l+2],ax
|
||||
shr eax,16
|
||||
mov [graph_data_l+4],al
|
||||
mov [graph_data_l+7],ah
|
||||
|
||||
|
||||
; BUILD SCHEDULER
|
||||
|
||||
call build_scheduler ; sys32.inc
|
||||
|
||||
; LOAD IDT
|
||||
lidt [cs:idtreg]
|
||||
cli
|
||||
|
||||
;!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
include 'detect/disks.inc'
|
||||
;!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
; READ RAMDISK IMAGE FROM HD
|
||||
|
||||
;!!!!!!!!!!!!!!!!!!!!!!!
|
||||
;include 'rdload.inc'
|
||||
;!!!!!!!!!!!!!!!!!!!!!!!
|
||||
; mov [dma_hdd],1
|
||||
; CALCULATE FAT CHAIN FOR RAMDISK
|
||||
|
||||
call calculatefatchain
|
||||
|
||||
; LOAD VMODE DRIVER
|
||||
|
||||
;!!!!!!!!!!!!!!!!!!!!!!!
|
||||
include 'vmodeld.inc'
|
||||
;!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
; LOAD FONTS I and II
|
||||
|
||||
mov [CURRENT_TASK],dword 1
|
||||
mov [TASK_COUNT],dword 1
|
||||
mov [TASK_BASE],dword TASK_DATA
|
||||
|
||||
pushad
|
||||
push eax
|
||||
mov eax,char - std_application_base_address
|
||||
call file_system_lfn
|
||||
mov eax,char2 - std_application_base_address
|
||||
call file_system_lfn
|
||||
pop eax
|
||||
popad
|
||||
|
||||
|
||||
; mov esi,char
|
||||
; xor ebx,ebx
|
||||
; mov ecx,2560;26000
|
||||
; mov edx,FONT_I
|
||||
; call fs_RamdiskRead
|
||||
|
||||
; mov esi,char2
|
||||
; xor ebx,ebx
|
||||
; mov ecx,2560;26000
|
||||
; mov edx,FONT_II
|
||||
; call fs_RamdiskRead
|
||||
|
||||
mov esi,boot_fonts
|
||||
call boot_log
|
||||
|
||||
; PRINT AMOUNT OF MEMORY
|
||||
mov esi, boot_memdetect
|
||||
call boot_log
|
||||
|
||||
movzx ecx, word [boot_y]
|
||||
or ecx, (10+29*6) shl 16 ; "Determining amount of memory"
|
||||
sub ecx, 10
|
||||
mov edx, 0xFFFFFF
|
||||
mov ebx, [MEM_AMOUNT]
|
||||
shr ebx, 20
|
||||
mov edi, 1
|
||||
mov eax, 0x00040000
|
||||
call display_number_force
|
||||
|
||||
; REDIRECT ALL IRQ'S TO INT'S 0x20-0x2f
|
||||
|
||||
mov esi,boot_irqs
|
||||
call boot_log
|
||||
call rerouteirqs
|
||||
|
||||
mov esi,boot_tss
|
||||
call boot_log
|
||||
|
||||
mov esi,boot_devices
|
||||
call boot_log
|
||||
call detect_devices
|
||||
|
||||
; TIMER SET TO 1/100 S
|
||||
|
||||
mov esi,boot_timer
|
||||
call boot_log
|
||||
mov al,0x34 ; set to 100Hz
|
||||
out 0x43,al
|
||||
mov al,0x9b ; lsb 1193180 / 1193
|
||||
out 0x40,al
|
||||
mov al,0x2e ; msb
|
||||
out 0x40,al
|
||||
|
||||
; SET MOUSE
|
||||
|
||||
mov esi,boot_setmouse
|
||||
call boot_log
|
||||
call setmouse
|
||||
|
||||
mov [pci_access_enabled],1
|
||||
|
||||
; SET PRELIMINARY WINDOW STACK AND POSITIONS
|
||||
|
||||
mov esi,boot_windefs
|
||||
call boot_log
|
||||
call setwindowdefaults
|
||||
|
||||
; SET BACKGROUND DEFAULTS
|
||||
|
||||
mov esi,boot_bgr
|
||||
call boot_log
|
||||
call calculatebackground
|
||||
|
||||
; RESERVE SYSTEM IRQ'S JA PORT'S
|
||||
|
||||
mov esi,boot_resirqports
|
||||
call boot_log
|
||||
call reserve_irqs_ports
|
||||
|
||||
; SET PORTS FOR IRQ HANDLERS
|
||||
|
||||
mov esi,boot_setrports
|
||||
call boot_log
|
||||
call setirqreadports
|
||||
|
||||
; SET UP OS TASK
|
||||
|
||||
mov esi,boot_setostask
|
||||
call boot_log
|
||||
|
||||
; mov eax, fpu_data
|
||||
; mov dword [SLOT_BASE+APPDATA.fpu_state], eax
|
||||
; mov dword [SLOT_BASE+APPDATA.fpu_handler], 0
|
||||
; mov dword [SLOT_BASE+APPDATA.sse_handler], 0
|
||||
|
||||
; name for OS/IDLE process
|
||||
|
||||
mov dword [SLOT_BASE+256+APPDATA.app_name], dword 'OS/I'
|
||||
mov dword [SLOT_BASE+256+APPDATA.app_name+4], dword 'DLE '
|
||||
mov edi, [os_stack]
|
||||
mov dword [SLOT_BASE+256+APPDATA.pl0_stack], edi
|
||||
add edi, RING0_STACK_SIZE
|
||||
mov dword [SLOT_BASE+256+APPDATA.fpu_state], edi
|
||||
|
||||
mov esi, fpu_data
|
||||
mov ecx, 512/4
|
||||
cld
|
||||
rep movsd
|
||||
|
||||
mov dword [SLOT_BASE+256+APPDATA.fpu_handler], 0
|
||||
mov dword [SLOT_BASE+256+APPDATA.sse_handler], 0
|
||||
|
||||
mov ebx, [def_cursor]
|
||||
mov dword [SLOT_BASE+256+APPDATA.cursor], ebx
|
||||
|
||||
mov ebx, SLOT_BASE+256+APP_OBJ_OFFSET
|
||||
mov dword [SLOT_BASE+256+APPDATA.fd_obj], ebx
|
||||
mov dword [SLOT_BASE+256+APPDATA.bk_obj], ebx
|
||||
|
||||
; task list
|
||||
mov [TASK_DATA+TASKDATA.wnd_number], 1 ; on screen number
|
||||
mov [TASK_DATA+TASKDATA.pid], 1 ; process id number
|
||||
mov [TASK_DATA+TASKDATA.mem_start], 0 ; process base address
|
||||
|
||||
mov edi,tss_data+tss_step
|
||||
mov ecx, (tss_step)/4
|
||||
xor eax, eax
|
||||
cld
|
||||
rep stosd
|
||||
|
||||
mov edi,tss_data+tss_step
|
||||
mov [edi+TSS._ss0], os_data
|
||||
mov eax,cr3
|
||||
mov [edi+TSS._cr3],eax
|
||||
mov [edi+TSS._eip],osloop
|
||||
mov [edi+TSS._eflags],dword 0x11202 ; sti and resume
|
||||
mov eax, [os_stack]
|
||||
add eax, RING0_STACK_SIZE
|
||||
mov [edi+TSS._esp], eax
|
||||
mov [edi+TSS._cs],os_code
|
||||
mov [edi+TSS._ss],os_data
|
||||
mov [edi+TSS._ds],os_data
|
||||
mov [edi+TSS._es],os_data
|
||||
mov [edi+TSS._fs],os_data
|
||||
mov [edi+TSS._gs],os_data
|
||||
|
||||
mov ax,tss0
|
||||
ltr ax
|
||||
|
||||
call init_cursors
|
||||
|
||||
|
||||
; READ TSC / SECOND
|
||||
|
||||
mov esi,boot_tsc
|
||||
call boot_log
|
||||
call _rdtsc
|
||||
mov ecx,eax
|
||||
mov esi,250 ; wait 1/4 a second
|
||||
call delay_ms
|
||||
call _rdtsc
|
||||
sub eax,ecx
|
||||
shl eax,2
|
||||
mov [CPU_FREQ],eax ; save tsc / sec
|
||||
mov ebx, 1000000
|
||||
div ebx
|
||||
mov [stall_mcs], eax
|
||||
|
||||
; SET VARIABLES
|
||||
|
||||
call set_variables
|
||||
|
||||
; STACK AND FDC
|
||||
|
||||
call stack_init
|
||||
call fdc_init
|
||||
|
||||
; PALETTE FOR 320x200 and 640x480 16 col
|
||||
|
||||
cmp [SCR_MODE],word 0x12
|
||||
jne no_pal_vga
|
||||
mov esi,boot_pal_vga
|
||||
call boot_log
|
||||
call paletteVGA
|
||||
no_pal_vga:
|
||||
|
||||
cmp [SCR_MODE],word 0x13
|
||||
jne no_pal_ega
|
||||
mov esi,boot_pal_ega
|
||||
call boot_log
|
||||
call palette320x200
|
||||
no_pal_ega:
|
||||
|
||||
; LOAD DEFAULT SKIN
|
||||
|
||||
mov esi,_skin_file_default
|
||||
mov edi,_skin_file
|
||||
movsd
|
||||
movsd
|
||||
movsd
|
||||
call load_skin
|
||||
|
||||
; LOAD FIRST APPLICATION
|
||||
mov [CURRENT_TASK],dword 1
|
||||
mov [TASK_COUNT],dword 1
|
||||
cli
|
||||
cmp byte [0x2f0000+0x9030],1
|
||||
jne no_load_vrr_m
|
||||
|
||||
mov ebp, vrr_m
|
||||
xor ebx, ebx
|
||||
xor edx, edx
|
||||
call fs_execute
|
||||
cmp eax,2 ; if vrr_m app found (PID=2)
|
||||
je first_app_found
|
||||
|
||||
no_load_vrr_m:
|
||||
mov ebp, firstapp
|
||||
xor ebx, ebx
|
||||
xor edx, edx
|
||||
call fs_execute
|
||||
cmp eax,2 ; continue if a process has been loaded
|
||||
je first_app_found
|
||||
mov eax, 0xDEADBEEF ; otherwise halt
|
||||
hlt
|
||||
first_app_found:
|
||||
cli
|
||||
|
||||
;mov [TASK_COUNT],dword 2
|
||||
mov [CURRENT_TASK],dword 1 ; set OS task fisrt
|
||||
|
||||
|
||||
; SET KEYBOARD PARAMETERS
|
||||
mov al, 0xf6 ; reset keyboard, scan enabled
|
||||
call kb_write
|
||||
|
||||
; wait until 8042 is ready
|
||||
xor ecx,ecx
|
||||
@@:
|
||||
in al,64h
|
||||
and al,00000010b
|
||||
loopnz @b
|
||||
|
||||
; mov al, 0xED ; svetodiody - only for testing!
|
||||
; call kb_write
|
||||
; call kb_read
|
||||
; mov al, 111b
|
||||
; call kb_write
|
||||
; call kb_read
|
||||
|
||||
mov al, 0xF3 ; set repeat rate & delay
|
||||
call kb_write
|
||||
; call kb_read
|
||||
mov al, 0 ; 30 250 ;00100010b ; 24 500 ;00100100b ; 20 500
|
||||
call kb_write
|
||||
; call kb_read
|
||||
;// mike.dld [
|
||||
call set_lights
|
||||
;// mike.dld ]
|
||||
|
||||
; START MULTITASKING
|
||||
|
||||
mov esi,boot_tasking
|
||||
call boot_log
|
||||
|
||||
; mov [ENABLE_TASKSWITCH],byte 1 ; multitasking enabled
|
||||
|
||||
; UNMASK ALL IRQ'S
|
||||
|
||||
mov esi,boot_allirqs
|
||||
call boot_log
|
||||
|
||||
cli ;guarantee forbidance of interrupts.
|
||||
mov al,0 ; unmask all irq's
|
||||
out 0xA1,al
|
||||
out 0x21,al
|
||||
|
||||
mov ecx,32
|
||||
|
||||
ready_for_irqs:
|
||||
|
||||
mov al,0x20 ; ready for irqs
|
||||
out 0x20,al
|
||||
out 0xa0,al
|
||||
|
||||
loop ready_for_irqs ; flush the queue
|
||||
|
||||
stdcall attach_int_handler, dword 1, irq1
|
||||
|
||||
; mov [dma_hdd],1
|
||||
cmp [IDEContrRegsBaseAddr], 0
|
||||
setnz [dma_hdd]
|
||||
|
||||
sti
|
||||
jmp $ ; wait here for timer to take control
|
||||
|
||||
; Fly :)
|
||||
|
||||
|
@ -1,28 +0,0 @@
|
||||
$Revision: 431 $
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;***************************************************
|
||||
; ïðåäâàðèòåëüíàÿ î÷èñòêà îáëàñòè òàáëèöû
|
||||
; ïîèñê è çàíåñåíèå â òàáëèöó ïðèâîäîâ FDD
|
||||
; àâòîð Mario79
|
||||
;***************************************************
|
||||
xor eax,eax
|
||||
mov edi,DRIVE_DATA
|
||||
mov ecx,16384
|
||||
cld
|
||||
rep stosd
|
||||
|
||||
mov al,0x10
|
||||
out 0x70,al
|
||||
mov cx,0xff
|
||||
wait_cmos:
|
||||
dec cx
|
||||
cmp cx,0
|
||||
jne wait_cmos
|
||||
in al,0x71
|
||||
mov [DRIVE_DATA],al
|
@ -1,382 +0,0 @@
|
||||
$Revision: 431 $
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;******************************************************
|
||||
; поиск приводов HDD и CD
|
||||
; автор исходного текста Кулаков Владимир Геннадьевич.
|
||||
; адаптация и доработка Mario79
|
||||
;******************************************************
|
||||
|
||||
;****************************************************
|
||||
;* ПОИСК HDD и CD *
|
||||
;****************************************************
|
||||
FindHDD:
|
||||
mov [ChannelNumber],1
|
||||
mov [DiskNumber],0
|
||||
call FindHDD_3
|
||||
; mov ax,[Sector512+176]
|
||||
; mov [DRIVE_DATA+6],ax
|
||||
; mov ax,[Sector512+126]
|
||||
; mov [DRIVE_DATA+8],ax
|
||||
; mov ax,[Sector512+128]
|
||||
; mov [DRIVE_DATA+8],ax
|
||||
mov [DiskNumber],1
|
||||
call FindHDD_3
|
||||
; mov al,[Sector512+176]
|
||||
; mov [DRIVE_DATA+7],al
|
||||
inc [ChannelNumber]
|
||||
mov [DiskNumber],0
|
||||
call FindHDD_3
|
||||
; mov al,[Sector512+176]
|
||||
; mov [DRIVE_DATA+8],al
|
||||
mov [DiskNumber],1
|
||||
call FindHDD_1
|
||||
; mov al,[Sector512+176]
|
||||
; mov [DRIVE_DATA+9],al
|
||||
|
||||
jmp EndFindHDD
|
||||
|
||||
FindHDD_1:
|
||||
call ReadHDD_ID
|
||||
cmp [DevErrorCode],0
|
||||
jne FindHDD_2
|
||||
cmp [Sector512+6],word 16
|
||||
ja FindHDD_2
|
||||
cmp [Sector512+12],word 255
|
||||
ja FindHDD_2
|
||||
inc byte [DRIVE_DATA+1]
|
||||
jmp FindHDD_2_2
|
||||
FindHDD_2:
|
||||
call DeviceReset
|
||||
cmp [DevErrorCode],0
|
||||
jne FindHDD_2_2
|
||||
call ReadCD_ID
|
||||
cmp [DevErrorCode],0
|
||||
jne FindHDD_2_2
|
||||
inc byte [DRIVE_DATA+1]
|
||||
inc byte [DRIVE_DATA+1]
|
||||
FindHDD_2_2:
|
||||
ret
|
||||
|
||||
FindHDD_3:
|
||||
call FindHDD_1
|
||||
shl byte [DRIVE_DATA+1],2
|
||||
ret
|
||||
|
||||
|
||||
; Адрес считываемого сектора в режиме LBA
|
||||
SectorAddress DD ?
|
||||
|
||||
;*************************************************
|
||||
;* ЧТЕНИЕ ИДЕНТИФИКАТОРА ЖЕСТКОГО ДИСКА *
|
||||
;* Входные параметры передаются через глобальные *
|
||||
;* переменные: *
|
||||
;* ChannelNumber - номер канала (1 или 2); *
|
||||
;* DiskNumber - номер диска на канале (0 или 1). *
|
||||
;* Идентификационный блок данных считывается *
|
||||
;* в массив Sector512. *
|
||||
;*************************************************
|
||||
ReadHDD_ID:
|
||||
; Задать режим CHS
|
||||
mov [ATAAddressMode],0
|
||||
; Послать команду идентификации устройства
|
||||
mov [ATAFeatures],0
|
||||
mov [ATAHead],0
|
||||
mov [ATACommand],0ECh
|
||||
call SendCommandToHDD
|
||||
cmp [DevErrorCode],0 ;проверить код ошибки
|
||||
jne @@End ;закончить, сохранив код ошибки
|
||||
mov DX,[ATABasePortAddr]
|
||||
add DX,7 ;адрес регистра состояни
|
||||
mov ecx,0xffff
|
||||
@@WaitCompleet:
|
||||
; Проверить время выполнения команды
|
||||
dec ecx
|
||||
cmp ecx,0
|
||||
je @@Error1 ;ошибка тайм-аута
|
||||
; Проверить готовность
|
||||
in AL,DX
|
||||
test AL,80h ;состояние сигнала BSY
|
||||
jnz @@WaitCompleet
|
||||
test AL,1 ;состояние сигнала ERR
|
||||
jnz @@Error6
|
||||
test AL,08h ;состояние сигнала DRQ
|
||||
jz @@WaitCompleet
|
||||
; Принять блок данных от контроллера
|
||||
; mov AX,DS
|
||||
; mov ES,AX
|
||||
mov EDI,Sector512 ;offset Sector512
|
||||
mov DX,[ATABasePortAddr] ;регистр данных
|
||||
mov CX,256 ;число считываемых слов
|
||||
rep insw ;принять блок данных
|
||||
jmp @@End
|
||||
; Записать код ошибки
|
||||
@@Error1:
|
||||
mov [DevErrorCode],1
|
||||
jmp @@End
|
||||
@@Error6:
|
||||
mov [DevErrorCode],6
|
||||
@@End: ret
|
||||
|
||||
|
||||
|
||||
; Стандартные базовые адреса каналов 1 и 2
|
||||
StandardATABases DW 1F0h, 170h
|
||||
; Номер канала
|
||||
ChannelNumber DW ?
|
||||
; Номер диска
|
||||
DiskNumber DB ?
|
||||
; Базовый адрес группы портов контроллера ATA
|
||||
ATABasePortAddr DW ?
|
||||
; Параметры ATA-команды
|
||||
ATAFeatures DB ? ;особенности
|
||||
ATASectorCount DB ? ;количество обрабатываемых секторов
|
||||
ATASectorNumber DB ? ;номер начального сектора
|
||||
ATACylinder DW ? ;номер начального цилиндра
|
||||
ATAHead DB ? ;номер начальной головки
|
||||
ATAAddressMode DB ? ;режим адресации (0 - CHS, 1 - LBA)
|
||||
ATACommand DB ? ;код команды, подлежащей выполнению
|
||||
; Код ошибки (0 - нет ошибок, 1 - превышен допустимый
|
||||
; интервал ожидания, 2 - неверный код режима адресации,
|
||||
; 3 - неверный номер канала, 4 - неверный номер диска,
|
||||
; 5 - неверный номер головки, 6 - ошибка при выполнении
|
||||
; команды)
|
||||
DevErrorCode DB ?
|
||||
|
||||
;****************************************************
|
||||
;* ПОСЛАТЬ КОМАНДУ ЗАДАННОМУ ДИСКУ *
|
||||
;* Входные параметры передаются через глобальные *
|
||||
;* переменные: *
|
||||
;* ChannelNumber - номер канала (1 или 2); *
|
||||
;* DiskNumber - номер диска (0 или 1); *
|
||||
;* ATAFeatures - "особенности"; *
|
||||
;* ATASectorCount - количество секторов; *
|
||||
;* ATASectorNumber - номер начального сектора; *
|
||||
;* ATACylinder - номер начального цилиндра; *
|
||||
;* ATAHead - номер начальной головки; *
|
||||
;* ATAAddressMode - режим адресации (0-CHS, 1-LBA); *
|
||||
;* ATACommand - код команды. *
|
||||
;* После успешного выполнения функции: *
|
||||
;* в ATABasePortAddr - базовый адрес HDD; *
|
||||
;* в DevErrorCode - ноль. *
|
||||
;* При возникновении ошибки в DevErrorCode будет *
|
||||
;* возвращен код ошибки. *
|
||||
;****************************************************
|
||||
SendCommandToHDD:
|
||||
; Проверить значение кода режима
|
||||
cmp [ATAAddressMode],1
|
||||
ja @@Err2
|
||||
; Проверить корректность номера канала
|
||||
mov BX,[ChannelNumber]
|
||||
cmp BX,1
|
||||
jb @@Err3
|
||||
cmp BX,2
|
||||
ja @@Err3
|
||||
; Установить базовый адрес
|
||||
dec BX
|
||||
shl BX,1
|
||||
movzx ebx,bx
|
||||
mov AX,[ebx+StandardATABases]
|
||||
mov [ATABasePortAddr],AX
|
||||
; Ожидание готовности HDD к приему команды
|
||||
; Выбрать нужный диск
|
||||
mov DX,[ATABasePortAddr]
|
||||
add DX,6 ;адрес регистра головок
|
||||
mov AL,[DiskNumber]
|
||||
cmp AL,1 ;проверить номера диска
|
||||
ja @@Err4
|
||||
shl AL,4
|
||||
or AL,10100000b
|
||||
out DX,AL
|
||||
; Ожидать, пока диск не будет готов
|
||||
inc DX
|
||||
mov ecx,0xfff
|
||||
; mov eax,[timer_ticks]
|
||||
; mov [TickCounter_1],eax
|
||||
@@WaitHDReady:
|
||||
; Проверить время ожидани
|
||||
dec ecx
|
||||
cmp ecx,0
|
||||
je @@Err1
|
||||
; mov eax,[timer_ticks]
|
||||
; sub eax,[TickCounter_1]
|
||||
; cmp eax,300 ;ожидать 300 тиков
|
||||
; ja @@Err1 ;ошибка тайм-аута
|
||||
; Прочитать регистр состояни
|
||||
in AL,DX
|
||||
; Проверить состояние сигнала BSY
|
||||
test AL,80h
|
||||
jnz @@WaitHDReady
|
||||
; Проверить состояние сигнала DRQ
|
||||
test AL,08h
|
||||
jnz @@WaitHDReady
|
||||
; Загрузить команду в регистры контроллера
|
||||
cli
|
||||
mov DX,[ATABasePortAddr]
|
||||
inc DX ;регистр "особенностей"
|
||||
mov AL,[ATAFeatures]
|
||||
out DX,AL
|
||||
inc DX ;счетчик секторов
|
||||
mov AL,[ATASectorCount]
|
||||
out DX,AL
|
||||
inc DX ;регистр номера сектора
|
||||
mov AL,[ATASectorNumber]
|
||||
out DX,AL
|
||||
inc DX ;номер цилиндра (младший байт)
|
||||
mov AX,[ATACylinder]
|
||||
out DX,AL
|
||||
inc DX ;номер цилиндра (старший байт)
|
||||
mov AL,AH
|
||||
out DX,AL
|
||||
inc DX ;номер головки/номер диска
|
||||
mov AL,[DiskNumber]
|
||||
shl AL,4
|
||||
cmp [ATAHead],0Fh ;проверить номер головки
|
||||
ja @@Err5
|
||||
or AL,[ATAHead]
|
||||
or AL,10100000b
|
||||
mov AH,[ATAAddressMode]
|
||||
shl AH,6
|
||||
or AL,AH
|
||||
out DX,AL
|
||||
; Послать команду
|
||||
mov AL,[ATACommand]
|
||||
inc DX ;регистр команд
|
||||
out DX,AL
|
||||
sti
|
||||
; Сбросить признак ошибки
|
||||
mov [DevErrorCode],0
|
||||
jmp @@End_2
|
||||
; Записать код ошибки
|
||||
@@Err1: mov [DevErrorCode],1
|
||||
jmp @@End_2
|
||||
@@Err2: mov [DevErrorCode],2
|
||||
jmp @@End_2
|
||||
@@Err3: mov [DevErrorCode],3
|
||||
jmp @@End_2
|
||||
@@Err4: mov [DevErrorCode],4
|
||||
jmp @@End_2
|
||||
@@Err5: mov [DevErrorCode],5
|
||||
; Завершение работы программы
|
||||
@@End_2:
|
||||
ret
|
||||
|
||||
;*************************************************
|
||||
;* ЧТЕНИЕ ИДЕНТИФИКАТОРА УСТРОЙСТВА ATAPI *
|
||||
;* Входные параметры передаются через глобальные *
|
||||
;* перменные: *
|
||||
;* ChannelNumber - номер канала; *
|
||||
;* DiskNumber - номер диска на канале. *
|
||||
;* Идентификационный блок данных считывается *
|
||||
;* в массив Sector512. *
|
||||
;*************************************************
|
||||
ReadCD_ID:
|
||||
; Задать режим CHS
|
||||
mov [ATAAddressMode],0
|
||||
; Послать команду идентификации устройства
|
||||
mov [ATAFeatures],0
|
||||
mov [ATASectorCount],0
|
||||
mov [ATASectorNumber],0
|
||||
mov [ATACylinder],0
|
||||
mov [ATAHead],0
|
||||
mov [ATACommand],0A1h
|
||||
call SendCommandToHDD
|
||||
cmp [DevErrorCode],0 ;проверить код ошибки
|
||||
jne @@End_1 ;закончить, сохранив код ошибки
|
||||
; Ожидать готовность данных HDD
|
||||
mov DX,[ATABasePortAddr]
|
||||
add DX,7 ;порт 1х7h
|
||||
mov ecx,0xffff
|
||||
@@WaitCompleet_1:
|
||||
; Проверить врем
|
||||
dec ecx
|
||||
cmp ecx,0
|
||||
je @@Error1_1 ;ошибка тайм-аута
|
||||
; Проверить готовность
|
||||
in AL,DX
|
||||
test AL,80h ;состояние сигнала BSY
|
||||
jnz @@WaitCompleet_1
|
||||
test AL,1 ;состояние сигнала ERR
|
||||
jnz @@Error6_1
|
||||
test AL,08h ;состояние сигнала DRQ
|
||||
jz @@WaitCompleet_1
|
||||
; Принять блок данных от контроллера
|
||||
; mov AX,DS
|
||||
; mov ES,AX
|
||||
mov EDI,Sector512 ;offset Sector512
|
||||
mov DX,[ATABasePortAddr] ;порт 1x0h
|
||||
mov CX,256 ;число считываемых слов
|
||||
rep insw
|
||||
jmp @@End_1
|
||||
; Записать код ошибки
|
||||
@@Error1_1:
|
||||
mov [DevErrorCode],1
|
||||
jmp @@End_1
|
||||
@@Error6_1:
|
||||
mov [DevErrorCode],6
|
||||
@@End_1:
|
||||
ret
|
||||
|
||||
;*************************************************
|
||||
;* СБРОС УСТРОЙСТВА *
|
||||
;* Входные параметры передаются через глобальные *
|
||||
;* переменные: *
|
||||
;* ChannelNumber - номер канала (1 или 2); *
|
||||
;* DiskNumber - номер диска (0 или 1). *
|
||||
;*************************************************
|
||||
DeviceReset:
|
||||
; Проверить корректность номера канала
|
||||
mov BX,[ChannelNumber]
|
||||
cmp BX,1
|
||||
jb @@Err3_2
|
||||
cmp BX,2
|
||||
ja @@Err3_2
|
||||
; Установить базовый адрес
|
||||
dec BX
|
||||
shl BX,1
|
||||
movzx ebx,bx
|
||||
mov DX,[ebx+StandardATABases]
|
||||
mov [ATABasePortAddr],DX
|
||||
; Выбрать нужный диск
|
||||
add DX,6 ;адрес регистра головок
|
||||
mov AL,[DiskNumber]
|
||||
cmp AL,1 ;проверить номера диска
|
||||
ja @@Err4_2
|
||||
shl AL,4
|
||||
or AL,10100000b
|
||||
out DX,AL
|
||||
; Послать команду "Сброс"
|
||||
mov AL,08h
|
||||
inc DX ;регистр команд
|
||||
out DX,AL
|
||||
mov ecx,0x80000
|
||||
@@WaitHDReady_1:
|
||||
; Проверить время ожидани
|
||||
dec ecx
|
||||
cmp ecx,0
|
||||
je @@Err1_2 ;ошибка тайм-аута
|
||||
; Прочитать регистр состояни
|
||||
in AL,DX
|
||||
; Проверить состояние сигнала BSY
|
||||
test AL,80h
|
||||
jnz @@WaitHDReady_1
|
||||
; Сбросить признак ошибки
|
||||
mov [DevErrorCode],0
|
||||
jmp @@End_3
|
||||
; Обработка ошибок
|
||||
@@Err1_2: mov [DevErrorCode],1
|
||||
jmp @@End_3
|
||||
@@Err3_2: mov [DevErrorCode],3
|
||||
jmp @@End_3
|
||||
@@Err4_2: mov [DevErrorCode],4
|
||||
; Записать код ошибки
|
||||
@@End_3:
|
||||
ret
|
||||
|
||||
EndFindHDD:
|
||||
|
@ -1,5 +0,0 @@
|
||||
$Revision: 425 $
|
||||
include 'dev_fd.inc'
|
||||
include 'dev_hdcd.inc'
|
||||
include 'sear_par.inc'
|
||||
|
@ -1,125 +0,0 @@
|
||||
$Revision: 431 $
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;****************************************************
|
||||
; ïîèñê ëîãè÷åñêèõ äèñêîâ íà îáíàðóæåííûõ HDD
|
||||
; è çàíåñåíèå äàííûõ â îáëàñòü òàáëèöû
|
||||
; àâòîð Mario79
|
||||
;****************************************************
|
||||
mov [transfer_adress],DRIVE_DATA+0xa
|
||||
search_partitions_ide0:
|
||||
test [DRIVE_DATA+1],byte 0x40
|
||||
jz search_partitions_ide1
|
||||
mov [hdbase],0x1f0
|
||||
mov [hdid],0x0
|
||||
mov [hdpos],1
|
||||
mov [fat32part],1
|
||||
search_partitions_ide0_1:
|
||||
call set_FAT32_variables
|
||||
cmp [problem_partition],0
|
||||
jne search_partitions_ide1
|
||||
inc byte [DRIVE_DATA+2]
|
||||
call partition_data_transfer
|
||||
add [transfer_adress],100
|
||||
inc [fat32part]
|
||||
jmp search_partitions_ide0_1
|
||||
|
||||
search_partitions_ide1:
|
||||
test [DRIVE_DATA+1],byte 0x10
|
||||
jz search_partitions_ide2
|
||||
mov [hdbase],0x1f0
|
||||
mov [hdid],0x10
|
||||
mov [hdpos],2
|
||||
mov [fat32part],1
|
||||
search_partitions_ide1_1:
|
||||
call set_FAT32_variables
|
||||
cmp [problem_partition],0
|
||||
jne search_partitions_ide2
|
||||
inc byte [DRIVE_DATA+3]
|
||||
call partition_data_transfer
|
||||
add [transfer_adress],100
|
||||
inc [fat32part]
|
||||
jmp search_partitions_ide1_1
|
||||
|
||||
search_partitions_ide2:
|
||||
test [DRIVE_DATA+1],byte 0x4
|
||||
jz search_partitions_ide3
|
||||
mov [hdbase],0x170
|
||||
mov [hdid],0x0
|
||||
mov [hdpos],3
|
||||
mov [fat32part],1
|
||||
search_partitions_ide2_1:
|
||||
call set_FAT32_variables
|
||||
cmp [problem_partition],0
|
||||
jne search_partitions_ide3
|
||||
inc byte [DRIVE_DATA+4]
|
||||
call partition_data_transfer
|
||||
add [transfer_adress],100
|
||||
inc [fat32part]
|
||||
jmp search_partitions_ide2_1
|
||||
|
||||
search_partitions_ide3:
|
||||
test [DRIVE_DATA+1],byte 0x1
|
||||
jz end_search_partitions_ide
|
||||
mov [hdbase],0x170
|
||||
mov [hdid],0x10
|
||||
mov [hdpos],4
|
||||
mov [fat32part],1
|
||||
search_partitions_ide3_1:
|
||||
call set_FAT32_variables
|
||||
cmp [problem_partition],0
|
||||
jne end_search_partitions_ide
|
||||
inc byte [DRIVE_DATA+5]
|
||||
call partition_data_transfer
|
||||
add [transfer_adress],100
|
||||
inc [fat32part]
|
||||
jmp search_partitions_ide3_1
|
||||
|
||||
|
||||
partition_data_transfer:
|
||||
mov edi,[transfer_adress]
|
||||
mov esi,PARTITION_START
|
||||
mov ecx,(file_system_data_size+3)/4
|
||||
rep movsd
|
||||
ret
|
||||
uglobal
|
||||
transfer_adress dd 0
|
||||
endg
|
||||
partition_data_transfer_1:
|
||||
; cli
|
||||
push edi
|
||||
mov edi,PARTITION_START
|
||||
mov esi,[transfer_adress]
|
||||
mov ecx,(file_system_data_size+3)/4
|
||||
rep movsd
|
||||
pop edi
|
||||
; sti
|
||||
ret
|
||||
|
||||
end_search_partitions_ide:
|
||||
|
||||
;PARTITION_START dd 0x3f
|
||||
;PARTITION_END dd 0
|
||||
;SECTORS_PER_FAT dd 0x1f3a
|
||||
;NUMBER_OF_FATS dd 0x2
|
||||
;SECTORS_PER_CLUSTER dd 0x8
|
||||
;BYTES_PER_SECTOR dd 0x200 ; Note: if BPS <> 512 need lots of changes
|
||||
;ROOT_CLUSTER dd 2 ; first rootdir cluster
|
||||
;FAT_START dd 0 ; start of fat table
|
||||
;ROOT_START dd 0 ; start of rootdir (only fat16)
|
||||
;ROOT_SECTORS dd 0 ; count of rootdir sectors (only fat16)
|
||||
;DATA_START dd 0 ; start of data area (=first cluster 2)
|
||||
;LAST_CLUSTER dd 0 ; last availabe cluster
|
||||
;ADR_FSINFO dd 0 ; used only by fat32
|
||||
;
|
||||
;fatRESERVED dd 0x0FFFFFF6
|
||||
;fatBAD dd 0x0FFFFFF7
|
||||
;fatEND dd 0x0FFFFFF8
|
||||
;fatMASK dd 0x0FFFFFFF
|
||||
;
|
||||
;fat_type db 0 ; 0=none, 16=fat16, 32=fat32
|
||||
|
@ -1,102 +0,0 @@
|
||||
$Revision: 431 $
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
; READ RAMDISK IMAGE FROM HD
|
||||
|
||||
cmp [boot_dev],1
|
||||
jne no_sys_on_hd
|
||||
|
||||
test [DRIVE_DATA+1],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 [DRIVE_DATA+2]
|
||||
cmp [fat32part],eax
|
||||
jle position_1_1
|
||||
position_2:
|
||||
test [DRIVE_DATA+1],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 [DRIVE_DATA+3]
|
||||
cmp eax,[fat32part]
|
||||
jle position_2_1
|
||||
position_3:
|
||||
test [DRIVE_DATA+1],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 [DRIVE_DATA+4]
|
||||
cmp eax,[fat32part]
|
||||
jle position_3_1
|
||||
position_4:
|
||||
test [DRIVE_DATA+1],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 [DRIVE_DATA+5]
|
||||
cmp eax,[fat32part]
|
||||
jle position_4_1
|
||||
jmp yes_sys_on_hd
|
||||
|
||||
search_and_read_image:
|
||||
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, RAMDISK
|
||||
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:
|
@ -1,65 +0,0 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; SWITCH TO 32 BIT PROTECTED MODE ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
os_data = os_data_l-gdts ; GDTs
|
||||
os_code = os_code_l-gdts
|
||||
int_code equ int_code_l-gdts
|
||||
int_data equ int_data_l-gdts
|
||||
tss0sys equ tss0sys_l-gdts
|
||||
graph_data equ 3+graph_data_l-gdts
|
||||
tss0 equ tss0_l-gdts
|
||||
app_code equ 3+app_code_l-gdts
|
||||
app_data equ 3+app_data_l-gdts
|
||||
|
||||
|
||||
|
||||
; CR0 Flags - Protected mode and Paging
|
||||
|
||||
mov ecx, CR0_PE
|
||||
|
||||
; Enabling 32 bit protected mode
|
||||
|
||||
sidt [cs:old_ints_h-0x10000]
|
||||
|
||||
cli ; disable all irqs
|
||||
cld
|
||||
mov al,255 ; mask all irqs
|
||||
out 0xa1,al
|
||||
out 0x21,al
|
||||
l.5: in al, 0x64 ; Enable A20
|
||||
test al, 2
|
||||
jnz l.5
|
||||
mov al, 0xD1
|
||||
out 0x64, al
|
||||
l.6: in al, 0x64
|
||||
test al, 2
|
||||
jnz l.6
|
||||
mov al, 0xDF
|
||||
out 0x60, al
|
||||
l.7: in al, 0x64
|
||||
test al, 2
|
||||
jnz l.7
|
||||
mov al, 0xFF
|
||||
out 0x64, al
|
||||
lgdt [cs:gdts-0x10000] ; Load GDT
|
||||
mov eax, cr0 ; Turn on paging // protected mode
|
||||
or eax, ecx
|
||||
and eax, 10011111b *65536*256 + 0xffffff ; caching enabled
|
||||
mov cr0, eax
|
||||
jmp $+2
|
||||
org $+0x10000
|
||||
mov ax,os_data ; Selector for os
|
||||
mov ds,ax
|
||||
mov es,ax
|
||||
mov fs,ax
|
||||
mov gs,ax
|
||||
mov ss,ax
|
||||
mov esp,0x3ec00 ; Set stack
|
||||
jmp pword os_code:B32 ; jmp to enable 32 bit mode
|
||||
|
||||
if gdte >= $
|
||||
error 'GDT overlaps with used code!'
|
||||
end if
|
@ -1,38 +0,0 @@
|
||||
$Revision: 431 $
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;
|
||||
; Load of videomode driver in memory
|
||||
;
|
||||
; (driver is located at 0x760000-0x768000 - 32kb) // if this area not occuped anything
|
||||
;
|
||||
; Author: Trans
|
||||
; Date: 19.07.2003
|
||||
;
|
||||
; Include in MeOS kernel and compile with FASM
|
||||
;
|
||||
|
||||
|
||||
; LOAD VIDEOMODE DRIVER
|
||||
; If vmode.mdr file not found
|
||||
or eax,-1 ; Driver ID = -1 (not present in system)
|
||||
mov [OS_BASE+0x760000],eax ;
|
||||
mov [OS_BASE+0x760100],byte 0xC3 ; Instruction RETN - driver loop
|
||||
|
||||
pushad
|
||||
push eax
|
||||
mov eax, vmode - std_application_base_address
|
||||
call file_system_lfn
|
||||
pop eax
|
||||
popad
|
||||
|
||||
; mov esi, vmode
|
||||
; xor ebx, ebx
|
||||
; mov ecx, 0x8000 ; size of memory area for driver
|
||||
; mov edx, OS_BASE+0x760000 ; Memory position of driver
|
||||
; call fs_RamdiskRead
|
@ -1,32 +0,0 @@
|
||||
@echo off
|
||||
set drivers=sound sis infinity ati2d
|
||||
|
||||
mkdir bin
|
||||
mkdir bin\drivers
|
||||
mkdir bin\skins
|
||||
:Target_kernel
|
||||
echo building kernel
|
||||
|
||||
echo lang fix en > lang.inc
|
||||
fasm -m 65536 kernel.asm bin\kernel.mnt
|
||||
|
||||
|
||||
:Target_drivers
|
||||
echo building drivers ...
|
||||
|
||||
for %%a in (%drivers%) do (
|
||||
fasm -m 65536 drivers\%%a.asm bin\drivers\%%a.obj
|
||||
)
|
||||
|
||||
|
||||
:Target_skins
|
||||
echo building skins ...
|
||||
cd skin
|
||||
fasm -m 65536 default.asm ..\bin\skins\default.skn
|
||||
cd ..
|
||||
pause
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,50 +0,0 @@
|
||||
$Revision: 431 $
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;; PCI16.INC ;;
|
||||
;; ;;
|
||||
;; 16 bit PCI driver code ;;
|
||||
;; ;;
|
||||
;; Version 0.2 December 21st, 2002 ;;
|
||||
;; ;;
|
||||
;; Author: Victor Prodan, victorprodan@yahoo.com ;;
|
||||
;; ;;
|
||||
;; See file COPYING for details ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
|
||||
init_pci_16:
|
||||
|
||||
pushad
|
||||
|
||||
xor ax,ax
|
||||
mov es,ax
|
||||
mov byte [es:0x9020],1 ;default mechanism:1
|
||||
mov ax,0xb101
|
||||
int 0x1a
|
||||
or ah,ah
|
||||
jnz pci16skip
|
||||
|
||||
mov [es:0x9021],cl ;last PCI bus in system
|
||||
mov [es:0x9022],bx
|
||||
mov [es:0x9024],edi
|
||||
|
||||
; we have a PCI BIOS, so check which configuration mechanism(s)
|
||||
; it supports
|
||||
; AL = PCI hardware characteristics (bit0 => mechanism1, bit1 => mechanism2)
|
||||
test al,1
|
||||
jnz pci16skip
|
||||
test al,2
|
||||
jz pci16skip
|
||||
mov byte [es:0x9020],2 ; if (al&3)==2 => mechanism 2
|
||||
|
||||
pci16skip:
|
||||
|
||||
mov ax,0x1000
|
||||
mov es,ax
|
||||
|
||||
popad
|
@ -1,363 +0,0 @@
|
||||
$Revision: 431 $
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;; ;;
|
||||
;; PCI32.INC ;;
|
||||
;; ;;
|
||||
;; 32 bit PCI driver code ;;
|
||||
;; ;;
|
||||
;; Version 0.2 December 21st, 2002 ;;
|
||||
;; ;;
|
||||
;; Author: Victor Prodan, victorprodan@yahoo.com ;;
|
||||
;; Credits: ;;
|
||||
;; Ralf Brown ;;
|
||||
;; Mike Hibbett, mikeh@oceanfree.net ;;
|
||||
;; ;;
|
||||
;; See file COPYING for details ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
|
||||
;***************************************************************************
|
||||
; Function
|
||||
; pci_api:
|
||||
;
|
||||
; Description
|
||||
; entry point for system PCI calls
|
||||
;***************************************************************************
|
||||
|
||||
align 4
|
||||
|
||||
pci_api:
|
||||
|
||||
cmp [pci_access_enabled],1
|
||||
jne no_pci_access_for_applications
|
||||
|
||||
or al,al
|
||||
jnz pci_fn_1
|
||||
; PCI function 0: get pci version (AH.AL)
|
||||
movzx eax,word [0x2F0000+0x9022]
|
||||
ret
|
||||
|
||||
pci_fn_1:
|
||||
cmp al,1
|
||||
jnz pci_fn_2
|
||||
|
||||
; PCI function 1: get last bus in AL
|
||||
mov al,[0x2F0000+0x9021]
|
||||
ret
|
||||
|
||||
pci_fn_2:
|
||||
cmp al,2
|
||||
jne pci_fn_3
|
||||
; PCI function 2: get pci access mechanism
|
||||
mov al,[0x2F0000+0x9020]
|
||||
ret
|
||||
pci_fn_3:
|
||||
|
||||
cmp al,4
|
||||
jz pci_read_reg ;byte
|
||||
cmp al,5
|
||||
jz pci_read_reg ;word
|
||||
cmp al,6
|
||||
jz pci_read_reg ;dword
|
||||
|
||||
cmp al,8
|
||||
jz pci_write_reg ;byte
|
||||
cmp al,9
|
||||
jz pci_write_reg ;word
|
||||
cmp al,10
|
||||
jz pci_write_reg ;dword
|
||||
|
||||
no_pci_access_for_applications:
|
||||
|
||||
mov eax,-1
|
||||
|
||||
ret
|
||||
|
||||
;***************************************************************************
|
||||
; Function
|
||||
; pci_make_config_cmd
|
||||
;
|
||||
; Description
|
||||
; creates a command dword for use with the PCI bus
|
||||
; bus # in ah
|
||||
; device+func in bh (dddddfff)
|
||||
; register in bl
|
||||
;
|
||||
; command dword returned in eax ( 10000000 bbbbbbbb dddddfff rrrrrr00 )
|
||||
;***************************************************************************
|
||||
|
||||
align 4
|
||||
|
||||
pci_make_config_cmd:
|
||||
shl eax,8 ; move bus to bits 16-23
|
||||
mov ax,bx ; combine all
|
||||
and eax,0xffffff
|
||||
or eax,0x80000000
|
||||
ret
|
||||
|
||||
;***************************************************************************
|
||||
; Function
|
||||
; pci_read_reg:
|
||||
;
|
||||
; Description
|
||||
; read a register from the PCI config space into EAX/AX/AL
|
||||
; IN: ah=bus,device+func=bh,register address=bl
|
||||
; number of bytes to read (1,2,4) coded into AL, bits 0-1
|
||||
;***************************************************************************
|
||||
|
||||
align 4
|
||||
|
||||
pci_read_reg:
|
||||
cmp byte [0x2F0000+0x9020],2 ;what mechanism will we use?
|
||||
je pci_read_reg_2
|
||||
|
||||
; mechanism 1
|
||||
push esi ; save register size into ESI
|
||||
mov esi,eax
|
||||
and esi,3
|
||||
|
||||
call pci_make_config_cmd
|
||||
mov ebx,eax
|
||||
; get current state
|
||||
mov dx,0xcf8
|
||||
in eax, dx
|
||||
push eax
|
||||
; set up addressing to config data
|
||||
mov eax,ebx
|
||||
and al,0xfc ; make address dword-aligned
|
||||
out dx,eax
|
||||
; get requested DWORD of config data
|
||||
mov dl,0xfc
|
||||
and bl,3
|
||||
or dl,bl ; add to port address first 2 bits of register address
|
||||
|
||||
or esi,esi
|
||||
jz pci_read_byte1
|
||||
cmp esi,1
|
||||
jz pci_read_word1
|
||||
cmp esi,2
|
||||
jz pci_read_dword1
|
||||
jmp pci_fin_read1
|
||||
|
||||
pci_read_byte1:
|
||||
in al,dx
|
||||
jmp pci_fin_read1
|
||||
pci_read_word1:
|
||||
in ax,dx
|
||||
jmp pci_fin_read1
|
||||
pci_read_dword1:
|
||||
in eax,dx
|
||||
jmp pci_fin_read1
|
||||
pci_fin_read1:
|
||||
; restore configuration control
|
||||
xchg eax,[esp]
|
||||
mov dx,0xcf8
|
||||
out dx,eax
|
||||
|
||||
pop eax
|
||||
pop esi
|
||||
ret
|
||||
pci_read_reg_2:
|
||||
|
||||
test bh,128 ;mech#2 only supports 16 devices per bus
|
||||
jnz pci_read_reg_err
|
||||
|
||||
push esi ; save register size into ESI
|
||||
mov esi,eax
|
||||
and esi,3
|
||||
|
||||
push eax
|
||||
;store current state of config space
|
||||
mov dx,0xcf8
|
||||
in al,dx
|
||||
mov ah,al
|
||||
mov dl,0xfa
|
||||
in al,dx
|
||||
|
||||
xchg eax,[esp]
|
||||
; out 0xcfa,bus
|
||||
mov al,ah
|
||||
out dx,al
|
||||
; out 0xcf8,0x80
|
||||
mov dl,0xf8
|
||||
mov al,0x80
|
||||
out dx,al
|
||||
; compute addr
|
||||
shr bh,3 ; func is ignored in mechanism 2
|
||||
or bh,0xc0
|
||||
mov dx,bx
|
||||
|
||||
or esi,esi
|
||||
jz pci_read_byte2
|
||||
cmp esi,1
|
||||
jz pci_read_word2
|
||||
cmp esi,2
|
||||
jz pci_read_dword2
|
||||
jmp pci_fin_read2
|
||||
|
||||
pci_read_byte2:
|
||||
in al,dx
|
||||
jmp pci_fin_read2
|
||||
pci_read_word2:
|
||||
in ax,dx
|
||||
jmp pci_fin_read2
|
||||
pci_read_dword2:
|
||||
in eax,dx
|
||||
; jmp pci_fin_read2
|
||||
pci_fin_read2:
|
||||
|
||||
; restore configuration space
|
||||
xchg eax,[esp]
|
||||
mov dx,0xcfa
|
||||
out dx,al
|
||||
mov dl,0xf8
|
||||
mov al,ah
|
||||
out dx,al
|
||||
|
||||
pop eax
|
||||
pop esi
|
||||
ret
|
||||
|
||||
pci_read_reg_err:
|
||||
xor eax,eax
|
||||
dec eax
|
||||
ret
|
||||
|
||||
|
||||
;***************************************************************************
|
||||
; Function
|
||||
; pci_write_reg:
|
||||
;
|
||||
; Description
|
||||
; write a register from ECX/CX/CL into the PCI config space
|
||||
; IN: ah=bus,device+func=bh,register address (dword aligned)=bl,
|
||||
; value to write in ecx
|
||||
; number of bytes to write (1,2,4) coded into AL, bits 0-1
|
||||
;***************************************************************************
|
||||
|
||||
align 4
|
||||
|
||||
pci_write_reg:
|
||||
cmp byte [0x2F0000+0x9020],2 ;what mechanism will we use?
|
||||
je pci_write_reg_2
|
||||
|
||||
; mechanism 1
|
||||
push esi ; save register size into ESI
|
||||
mov esi,eax
|
||||
and esi,3
|
||||
|
||||
call pci_make_config_cmd
|
||||
mov ebx,eax
|
||||
; get current state into ecx
|
||||
mov dx,0xcf8
|
||||
in eax, dx
|
||||
push eax
|
||||
; set up addressing to config data
|
||||
mov eax,ebx
|
||||
and al,0xfc ; make address dword-aligned
|
||||
out dx,eax
|
||||
; write DWORD of config data
|
||||
mov dl,0xfc
|
||||
and bl,3
|
||||
or dl,bl
|
||||
mov eax,ecx
|
||||
|
||||
or esi,esi
|
||||
jz pci_write_byte1
|
||||
cmp esi,1
|
||||
jz pci_write_word1
|
||||
cmp esi,2
|
||||
jz pci_write_dword1
|
||||
jmp pci_fin_write1
|
||||
|
||||
pci_write_byte1:
|
||||
out dx,al
|
||||
jmp pci_fin_write1
|
||||
pci_write_word1:
|
||||
out dx,ax
|
||||
jmp pci_fin_write1
|
||||
pci_write_dword1:
|
||||
out dx,eax
|
||||
jmp pci_fin_write1
|
||||
pci_fin_write1:
|
||||
|
||||
; restore configuration control
|
||||
pop eax
|
||||
mov dl,0xf8
|
||||
out dx,eax
|
||||
|
||||
xor eax,eax
|
||||
pop esi
|
||||
|
||||
ret
|
||||
pci_write_reg_2:
|
||||
|
||||
test bh,128 ;mech#2 only supports 16 devices per bus
|
||||
jnz pci_write_reg_err
|
||||
|
||||
|
||||
push esi ; save register size into ESI
|
||||
mov esi,eax
|
||||
and esi,3
|
||||
|
||||
push eax
|
||||
;store current state of config space
|
||||
mov dx,0xcf8
|
||||
in al,dx
|
||||
mov ah,al
|
||||
mov dl,0xfa
|
||||
in al,dx
|
||||
xchg eax,[esp]
|
||||
; out 0xcfa,bus
|
||||
mov al,ah
|
||||
out dx,al
|
||||
; out 0xcf8,0x80
|
||||
mov dl,0xf8
|
||||
mov al,0x80
|
||||
out dx,al
|
||||
; compute addr
|
||||
shr bh,3 ; func is ignored in mechanism 2
|
||||
or bh,0xc0
|
||||
mov dx,bx
|
||||
; write register
|
||||
mov eax,ecx
|
||||
|
||||
or esi,esi
|
||||
jz pci_write_byte2
|
||||
cmp esi,1
|
||||
jz pci_write_word2
|
||||
cmp esi,2
|
||||
jz pci_write_dword2
|
||||
jmp pci_fin_write2
|
||||
|
||||
pci_write_byte2:
|
||||
out dx,al
|
||||
jmp pci_fin_write2
|
||||
pci_write_word2:
|
||||
out dx,ax
|
||||
jmp pci_fin_write2
|
||||
pci_write_dword2:
|
||||
out dx,eax
|
||||
jmp pci_fin_write2
|
||||
pci_fin_write2:
|
||||
; restore configuration space
|
||||
pop eax
|
||||
mov dx,0xcfa
|
||||
out dx,al
|
||||
mov dl,0xf8
|
||||
mov al,ah
|
||||
out dx,al
|
||||
|
||||
xor eax,eax
|
||||
pop esi
|
||||
ret
|
||||
|
||||
pci_write_reg_err:
|
||||
xor eax,eax
|
||||
dec eax
|
||||
ret
|
@ -1,576 +0,0 @@
|
||||
$Revision: 434 $
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
drw0 equ 10010010b ; data read/write dpl0
|
||||
drw3 equ 11110010b ; data read/write dpl3
|
||||
cpl0 equ 10011010b ; code read dpl0
|
||||
cpl3 equ 11111010b ; code read dpl3
|
||||
|
||||
D32 equ 01000000b ; 32bit segment
|
||||
G32 equ 10000000b ; page gran
|
||||
|
||||
|
||||
;;;;;;;;;;;;cpu_caps flags;;;;;;;;;;;;;;;;
|
||||
|
||||
CPU_386 equ 3
|
||||
CPU_486 equ 4
|
||||
CPU_PENTIUM equ 5
|
||||
CPU_P6 equ 6
|
||||
CPU_PENTIUM4 equ 0x0F
|
||||
|
||||
CAPS_FPU equ 00 ;on-chip x87 floating point unit
|
||||
CAPS_VME equ 01 ;virtual-mode enhancements
|
||||
CAPS_DE equ 02 ;debugging extensions
|
||||
CAPS_PSE equ 03 ;page-size extensions
|
||||
CAPS_TSC equ 04 ;time stamp counter
|
||||
CAPS_MSR equ 05 ;model-specific registers
|
||||
CAPS_PAE equ 06 ;physical-address extensions
|
||||
CAPS_MCE equ 07 ;machine check exception
|
||||
CAPS_CX8 equ 08 ;CMPXCHG8B instruction
|
||||
CAPS_APIC equ 09 ;on-chip advanced programmable
|
||||
; interrupt controller
|
||||
; 10 ;unused
|
||||
CAPS_SEP equ 11 ;SYSENTER and SYSEXIT instructions
|
||||
CAPS_MTRR equ 12 ;memory-type range registers
|
||||
CAPS_PGE equ 13 ;page global extension
|
||||
CAPS_MCA equ 14 ;machine check architecture
|
||||
CAPS_CMOV equ 15 ;conditional move instructions
|
||||
CAPS_PAT equ 16 ;page attribute table
|
||||
|
||||
CAPS_PSE36 equ 17 ;page-size extensions
|
||||
CAPS_PSN equ 18 ;processor serial number
|
||||
CAPS_CLFLUSH equ 19 ;CLFUSH instruction
|
||||
|
||||
CAPS_DS equ 21 ;debug store
|
||||
CAPS_ACPI equ 22 ;thermal monitor and software
|
||||
;controlled clock supported
|
||||
CAPS_MMX equ 23 ;MMX instructions
|
||||
CAPS_FXSR equ 24 ;FXSAVE and FXRSTOR instructions
|
||||
CAPS_SSE equ 25 ;SSE instructions
|
||||
CAPS_SSE2 equ 26 ;SSE2 instructions
|
||||
CAPS_SS equ 27 ;self-snoop
|
||||
CAPS_HTT equ 28 ;hyper-threading technology
|
||||
CAPS_TM equ 29 ;thermal monitor supported
|
||||
CAPS_IA64 equ 30 ;IA64 capabilities
|
||||
CAPS_PBE equ 31 ;pending break enable
|
||||
|
||||
;ecx
|
||||
CAPS_SSE3 equ 32 ;SSE3 instructions
|
||||
; 33
|
||||
; 34
|
||||
CAPS_MONITOR equ 35 ;MONITOR/MWAIT instructions
|
||||
CAPS_DS_CPL equ 36 ;
|
||||
CAPS_VMX equ 37 ;virtual mode extensions
|
||||
; 38 ;
|
||||
CAPS_EST equ 39 ;enhansed speed step
|
||||
CAPS_TM2 equ 40 ;thermal monitor2 supported
|
||||
; 41
|
||||
CAPS_CID equ 42 ;
|
||||
; 43
|
||||
; 44
|
||||
CAPS_CX16 equ 45 ;CMPXCHG16B instruction
|
||||
CAPS_xTPR equ 46 ;
|
||||
;
|
||||
;reserved
|
||||
;
|
||||
;ext edx /ecx
|
||||
CAPS_SYSCAL equ 64 ;
|
||||
CAPS_XD equ 65 ;execution disable
|
||||
CAPS_FFXSR equ 66 ;
|
||||
CAPS_RDTSCP equ 67 ;
|
||||
CAPS_X64 equ 68 ;
|
||||
CAPS_3DNOW equ 69 ;
|
||||
CAPS_3DNOWEXT equ 70 ;
|
||||
CAPS_LAHF equ 71 ;
|
||||
CAPS_CMP_LEG equ 72 ;
|
||||
CAPS_SVM equ 73 ;secure virual machine
|
||||
CAPS_ALTMOVCR8 equ 74 ;
|
||||
|
||||
; CPU MSR names
|
||||
MSR_SYSENTER_CS equ 0x174
|
||||
MSR_SYSENTER_ESP equ 0x175
|
||||
MSR_SYSENTER_EIP equ 0x176
|
||||
MSR_AMD_EFER equ 0xC0000080 ; Extended Feature Enable Register
|
||||
MSR_AMD_STAR equ 0xC0000081 ; SYSCALL/SYSRET Target Address Register
|
||||
|
||||
CR0_PE equ 0x00000001 ;protected mode
|
||||
CR0_MP equ 0x00000002 ;monitor fpu
|
||||
CR0_EM equ 0x00000004 ;fpu emulation
|
||||
CR0_TS equ 0x00000008 ;task switch
|
||||
CR0_ET equ 0x00000010 ;extension type hardcoded to 1
|
||||
CR0_NE equ 0x00000020 ;numeric error
|
||||
CR0_WP equ 0x00010000 ;write protect
|
||||
CR0_AM equ 0x00040000 ;alignment check
|
||||
CR0_NW equ 0x20000000 ;not write-through
|
||||
CR0_CD equ 0x40000000 ;cache disable
|
||||
CR0_PG equ 0x80000000 ;paging
|
||||
|
||||
|
||||
CR4_VME equ 0x0001
|
||||
CR4_PVI equ 0x0002
|
||||
CR4_TSD equ 0x0004
|
||||
CR4_DE equ 0x0008
|
||||
CR4_PSE equ 0x0010
|
||||
CR4_PAE equ 0x0020
|
||||
CR4_MCE equ 0x0040
|
||||
CR4_PGE equ 0x0080
|
||||
CR4_PCE equ 0x0100
|
||||
CR4_OSFXSR equ 0x0200
|
||||
CR4_OSXMMEXPT equ 0x0400
|
||||
|
||||
SSE_IE equ 0x0001
|
||||
SSE_DE equ 0x0002
|
||||
SSE_ZE equ 0x0004
|
||||
SSE_OE equ 0x0008
|
||||
SSE_UE equ 0x0010
|
||||
SSE_PE equ 0x0020
|
||||
SSE_DAZ equ 0x0040
|
||||
SSE_IM equ 0x0080
|
||||
SSE_DM equ 0x0100
|
||||
SSE_ZM equ 0x0200
|
||||
SSE_OM equ 0x0400
|
||||
SSE_UM equ 0x0800
|
||||
SSE_PM equ 0x1000
|
||||
SSE_FZ equ 0x8000
|
||||
|
||||
SSE_INIT equ (SSE_IM+SSE_DM+SSE_ZM+SSE_OM+SSE_UM+SSE_PM)
|
||||
|
||||
OS_BASE equ 0
|
||||
|
||||
window_data equ (OS_BASE+0x0000000)
|
||||
|
||||
CURRENT_TASK equ (OS_BASE+0x0003000)
|
||||
TASK_COUNT equ (OS_BASE+0x0003004)
|
||||
CURRENT_RING0_ESP equ (OS_BASE+0x0003008)
|
||||
TASK_BASE equ (OS_BASE+0x0003010)
|
||||
TASK_DATA equ (OS_BASE+0x0003020)
|
||||
TASK_EVENT equ (OS_BASE+0x0003020)
|
||||
|
||||
mouseunder equ (OS_BASE+0x0006900)
|
||||
FLOPPY_BUFF equ (OS_BASE+0x0008000)
|
||||
ACTIVE_PROC_STACK equ (OS_BASE+0x000A400) ;unused
|
||||
idts equ (OS_BASE+0x000B100)
|
||||
WIN_STACK equ (OS_BASE+0x000C000)
|
||||
WIN_POS equ (OS_BASE+0x000C400)
|
||||
FDD_BUFF equ (OS_BASE+0x000D000)
|
||||
|
||||
;unused ? only one reference
|
||||
ENABLE_TASKSWITCH equ (OS_BASE+0x000E000)
|
||||
|
||||
PUTPIXEL equ (OS_BASE+0x000E020)
|
||||
GETPIXEL equ (OS_BASE+0x000E024)
|
||||
|
||||
;unused ? only one reference
|
||||
BANK_SWITCH equ (OS_BASE+0x000E030)
|
||||
|
||||
;unused ? store mousepointer
|
||||
MOUSE_PICTURE equ (OS_BASE+0x000F200)
|
||||
|
||||
MOUSE_VISIBLE equ (OS_BASE+0x000F204)
|
||||
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_X equ (OS_BASE+0x000FB0A)
|
||||
MOUSE_Y equ (OS_BASE+0x000FB0C)
|
||||
|
||||
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)
|
||||
|
||||
LFBAddress equ (OS_BASE+0x000FE80)
|
||||
MEM_AMOUNT equ (OS_BASE+0x000FE8C)
|
||||
;LFBSize equ (OS_BASE+0x02f9050)
|
||||
|
||||
ScreenWidth equ (OS_BASE+0x000FE00)
|
||||
ScreenHeight equ (OS_BASE+0x000FE04)
|
||||
BytesPerScanLine equ (OS_BASE+0x000FE08)
|
||||
SCR_MODE equ (OS_BASE+0x000FE0C)
|
||||
|
||||
BTN_ADDR equ (OS_BASE+0x000FE88)
|
||||
SYS_SHUTDOWN equ (OS_BASE+0x000FF00)
|
||||
TASK_ACTIVATE equ (OS_BASE+0x000FF01)
|
||||
|
||||
REDRAW_BACKGROUND equ (OS_BASE+0x000FFF0)
|
||||
BANK_RW equ (OS_BASE+0x000FFF2)
|
||||
MOUSE_BACKGROUND equ (OS_BASE+0x000FFF4)
|
||||
DONT_DRAW_MOUSE equ (OS_BASE+0x000FFF5)
|
||||
DONT_SWITCH equ (OS_BASE+0x000FFFF)
|
||||
|
||||
TMP_STACK_TOP equ 0x003EC00
|
||||
|
||||
FONT_II equ (OS_BASE+0x003EC00)
|
||||
FONT_I equ (OS_BASE+0x003F600)
|
||||
DRIVE_DATA equ (OS_BASE+0x0040000)
|
||||
SLOT_BASE equ (OS_BASE+0x0080000)
|
||||
|
||||
;unused
|
||||
TMP_BUFF equ (OS_BASE+0x0090000)
|
||||
|
||||
VGABasePtr equ (OS_BASE+0x00A0000)
|
||||
|
||||
RAMDISK equ (OS_BASE+0x0100000)
|
||||
RAMDISK_FAT equ (OS_BASE+0x0280000)
|
||||
FLOPPY_FAT equ (OS_BASE+0x0282000)
|
||||
|
||||
; unused?
|
||||
SB16_Status equ (OS_BASE+0x02B0000)
|
||||
|
||||
BUTTON_INFO equ (OS_BASE+0x02C0000)
|
||||
RESERVED_PORTS equ (OS_BASE+0x02D0000)
|
||||
IRQ_SAVE equ (OS_BASE+0x02E0000)
|
||||
BOOT_VAR equ (OS_BASE+0x02f0000)
|
||||
IMG_BACKGROUND equ (OS_BASE+0x0300000)
|
||||
WinMapAddress equ (OS_BASE+0x0460000)
|
||||
display_data equ (OS_BASE+0x0460000)
|
||||
|
||||
;unused ?
|
||||
HD_CACHE equ (OS_BASE+0x0600000)
|
||||
|
||||
stack_data_start equ (OS_BASE+0x0700000)
|
||||
eth_data_start equ (OS_BASE+0x0700000)
|
||||
stack_data equ (OS_BASE+0x0704000)
|
||||
stack_data_end equ (OS_BASE+0x071ffff)
|
||||
VMODE_BASE equ (OS_BASE+0x0760000)
|
||||
resendQ equ (OS_BASE+0x0770000)
|
||||
|
||||
skin_data equ (OS_BASE+0x0778000)
|
||||
|
||||
|
||||
tss_data equ (OS_BASE+0x780000)
|
||||
draw_data equ (OS_BASE+0x988000)
|
||||
|
||||
HEAP_BASE equ (OS_BASE+0x98B000)
|
||||
|
||||
LFB_BASE equ 0x7DC00000
|
||||
|
||||
page_tabs equ 0x7FC00000
|
||||
master_tab equ 0x7FDFF000
|
||||
app_page_tabs equ 0x7FE00000
|
||||
|
||||
sys_pgdir equ OS_BASE+0x00050000
|
||||
sys_master_tab equ OS_BASE+0x00051000
|
||||
sys_pgmap equ OS_BASE+0x00052000
|
||||
|
||||
|
||||
|
||||
new_app_base equ 0x80000000
|
||||
|
||||
twdw equ (CURRENT_TASK-window_data)
|
||||
|
||||
std_application_base_address equ new_app_base
|
||||
RING0_STACK_SIZE equ (0x2000-512) ;512 áàéò äëÿ êîíòåêñòà FPU
|
||||
|
||||
;PAGES_USED equ 4
|
||||
|
||||
PG_UNMAP equ 0x000
|
||||
PG_MAP equ 0x001
|
||||
PG_WRITE equ 0x002
|
||||
PG_SW equ 0x003
|
||||
PG_USER equ 0x005
|
||||
PG_UW equ 0x007
|
||||
PG_NOCACHE equ 0x018
|
||||
PG_LARGE equ 0x080
|
||||
PG_GLOBAL equ 0x100
|
||||
|
||||
;;;;;;;;;;;boot time variables
|
||||
|
||||
;BOOT_BPP equ 0x9000 ;byte bits per pixel
|
||||
BOOT_SCANLINE equ 0x9001 ;word scanline length
|
||||
BOOT_VESA_MODE equ 0x9008 ;word vesa video mode
|
||||
;;BOOT_X_RES equ 0x900A ;word X res
|
||||
;;BOOT_Y_RES equ 0x900C ;word Y res
|
||||
;;BOOT_MOUSE_PORT equ 0x9010 ;byte mouse port - not used
|
||||
BOOT_BANK_SW equ 0x9014 ;dword Vesa 1.2 pm bank switch
|
||||
BOOT_LFB equ 0x9018 ;dword Vesa 2.0 LFB address
|
||||
BOOT_MTRR equ 0x901C ;byte 0 or 1 : enable MTRR graphics acceleration
|
||||
BOOT_LOG equ 0x901D ;byte not used anymore (0 or 1 : enable system log display)
|
||||
BOOT_DIRECT_LFB equ 0x901E ;byte 0 or 1 : enable direct lfb write, paging disabled
|
||||
BOOT_PCI_DATA equ 0x9020 ;8bytes pci data
|
||||
BOOT_VRR equ 0x9030 ;byte VRR start enabled 1, 2-no
|
||||
BOOT_IDE_BASE_ADDR equ 0x9031 ;word IDEContrRegsBaseAddr
|
||||
BOOT_MEM_AMOUNT equ 0x9034 ;dword memory amount
|
||||
|
||||
TMP_FILE_NAME equ 0
|
||||
TMP_CMD_LINE equ 1024
|
||||
TMP_ICON_OFFS equ 1280
|
||||
|
||||
|
||||
EVENT_REDRAW equ 0x00000001
|
||||
EVENT_KEY equ 0x00000002
|
||||
EVENT_BUTTON equ 0x00000004
|
||||
EVENT_BACKGROUND equ 0x00000010
|
||||
EVENT_MOUSE equ 0x00000020
|
||||
EVENT_IPC equ 0x00000040
|
||||
EVENT_NETWORK equ 0x00000080
|
||||
EVENT_DEBUG equ 0x00000100
|
||||
EVENT_EXTENDED equ 0x00000200
|
||||
|
||||
EV_INTR equ 1
|
||||
|
||||
struc SYS_VARS
|
||||
{ .bpp dd ?
|
||||
.scanline dd ?
|
||||
.vesa_mode dd ?
|
||||
.x_res dd ?
|
||||
.y_res dd ?
|
||||
.cpu_caps dd ?
|
||||
dd ?
|
||||
dd ?
|
||||
dd ?
|
||||
}
|
||||
|
||||
struc APPOBJ ;common object header
|
||||
{
|
||||
.magic dd ? ;
|
||||
.destroy dd ? ;internal destructor
|
||||
.fd dd ? ;next object in list
|
||||
.bk dd ? ;prev object in list
|
||||
.pid dd ? ;owner id
|
||||
};
|
||||
|
||||
virtual at 0
|
||||
APPOBJ APPOBJ
|
||||
end virtual
|
||||
|
||||
APP_OBJ_OFFSET equ 48
|
||||
APP_EV_OFFSET equ 40
|
||||
|
||||
struc CURSOR
|
||||
{;common object header
|
||||
.magic dd ? ;'CURS'
|
||||
.destroy dd ? ;internal destructor
|
||||
.fd dd ? ;next object in list
|
||||
.bk dd ? ;prev object in list
|
||||
.pid dd ? ;owner id
|
||||
|
||||
;cursor data
|
||||
.base dd ? ;allocated memory
|
||||
.hot_x dd ? ;hotspot coords
|
||||
.hot_y dd ?
|
||||
}
|
||||
virtual at 0
|
||||
CURSOR CURSOR
|
||||
end virtual
|
||||
|
||||
CURSOR_SIZE equ 32
|
||||
|
||||
struc EVENT
|
||||
{
|
||||
.magic dd ? ;'EVNT'
|
||||
.destroy dd ? ;internal destructor
|
||||
.fd dd ? ;next object in list
|
||||
.bk dd ? ;prev object in list
|
||||
.pid dd ? ;owner id
|
||||
|
||||
.id dd ? ;event uid
|
||||
.state dd ? ;internal flags
|
||||
.code dd ?
|
||||
rd 5
|
||||
}
|
||||
EVENT_SIZE equ 52
|
||||
|
||||
virtual at 0
|
||||
EVENT EVENT
|
||||
end virtual
|
||||
|
||||
|
||||
|
||||
struc HEAP_DATA
|
||||
{
|
||||
.mutex rd 1
|
||||
.refcount rd 1
|
||||
.heap_base rd 1
|
||||
.heap_top rd 1
|
||||
.app_mem rd 1
|
||||
}
|
||||
|
||||
HEAP_DATA_SIZE equ 20
|
||||
virtual at 0
|
||||
HEAP_DATA HEAP_DATA
|
||||
end virtual
|
||||
|
||||
struc BOOT_DATA
|
||||
{ .bpp dd ?
|
||||
.scanline dd ?
|
||||
.vesa_mode dd ?
|
||||
.x_res dd ?
|
||||
.y_res dd ?
|
||||
.mouse_port dd ?
|
||||
.bank_switch dd ?
|
||||
.lfb dd ?
|
||||
.vesa_mem dd ?
|
||||
.log dd ?
|
||||
.direct_lfb dd ?
|
||||
.pci_data dd ?
|
||||
; dd ?
|
||||
.vrr dd ?
|
||||
.ide_base dd ?
|
||||
.mem_amount dd ?
|
||||
.pages_count dd ?
|
||||
.pagemap_size dd ?
|
||||
.kernel_max dd ?
|
||||
.kernel_pages dd ?
|
||||
.kernel_tables dd ?
|
||||
|
||||
.cpu_vendor dd ?
|
||||
dd ?
|
||||
dd ?
|
||||
.cpu_sign dd ?
|
||||
.cpu_info dd ?
|
||||
.cpu_caps dd ?
|
||||
dd ?
|
||||
dd ?
|
||||
}
|
||||
|
||||
virtual at 0
|
||||
BOOT_DATA BOOT_DATA
|
||||
end virtual
|
||||
|
||||
struc MEM_STATE
|
||||
{ .mutex rd 1
|
||||
.smallmap rd 1
|
||||
.treemap rd 1
|
||||
.topsize rd 1
|
||||
.top rd 1
|
||||
.smallbins rd 4*32
|
||||
.treebins rd 32
|
||||
}
|
||||
|
||||
struc PG_DATA
|
||||
{ .mem_amount dd ?
|
||||
.vesa_mem dd ?
|
||||
.pages_count dd ?
|
||||
.pages_free dd ?
|
||||
.pages_faults dd ?
|
||||
.pagemap_size dd ?
|
||||
.kernel_max dd ?
|
||||
.kernel_pages dd ?
|
||||
.kernel_tables dd ?
|
||||
.sys_page_dir dd ?
|
||||
.pg_mutex dd ?
|
||||
}
|
||||
|
||||
;struc LIB
|
||||
;{ .lib_name rb 16
|
||||
; .lib_base dd ?
|
||||
; .lib_start dd ?
|
||||
; .export dd ?
|
||||
; .import dd ?
|
||||
;}
|
||||
|
||||
struc SRV
|
||||
{ .srv_name rb 16 ;ASCIIZ string
|
||||
.magic dd ? ;+0x10 ;'SRV '
|
||||
.size dd ? ;+0x14 ;size of structure SRV
|
||||
.fd dd ? ;+0x18 ;next SRV descriptor
|
||||
.bk dd ? ;+0x1C ;prev SRV descriptor
|
||||
.base dd ? ;+0x20 ;service base address
|
||||
.entry dd ? ;+0x24 ;service START function
|
||||
.srv_proc dd ? ;+0x28 ;main service handler
|
||||
}
|
||||
|
||||
SRV_FD_OFFSET equ 0x18
|
||||
SRV_SIZE equ 44
|
||||
|
||||
struc COFF_HEADER
|
||||
{ .machine dw ?
|
||||
.nSections dw ?
|
||||
.DataTime dd ?
|
||||
.pSymTable dd ?
|
||||
.nSymbols dd ?
|
||||
.optHeader dw ?
|
||||
.flags dw ?
|
||||
};
|
||||
|
||||
|
||||
struc COFF_SECTION
|
||||
{ .Name rb 8
|
||||
.VirtualSize dd ?
|
||||
.VirtualAddress dd ?
|
||||
.SizeOfRawData dd ?
|
||||
.PtrRawData dd ?
|
||||
.PtrReloc dd ?
|
||||
.PtrLinenumbers dd ?
|
||||
.NumReloc dw ?
|
||||
.NumLinenum dw ?
|
||||
.Characteristics dd ?
|
||||
}
|
||||
COFF_SECTION_SIZE equ 40
|
||||
|
||||
struc COFF_RELOC
|
||||
{ .VirtualAddress dd ?
|
||||
.SymIndex dd ?
|
||||
.Type dw ?
|
||||
}
|
||||
|
||||
struc COFF_SYM
|
||||
{ .Name rb 8
|
||||
.Value dd ?
|
||||
.SectionNumber dw ?
|
||||
.Type dw ?
|
||||
.StorageClass db ?
|
||||
.NumAuxSymbols db ?
|
||||
}
|
||||
CSYM_SIZE equ 18
|
||||
|
||||
struc IOCTL
|
||||
{ .handle dd ?
|
||||
.io_code dd ?
|
||||
.input dd ?
|
||||
.inp_size dd ?
|
||||
.output dd ?
|
||||
.out_size dd ?
|
||||
}
|
||||
|
||||
virtual at 0
|
||||
IOCTL IOCTL
|
||||
end virtual
|
||||
|
||||
;virtual at 0
|
||||
; LIB LIB
|
||||
;end virtual
|
||||
|
||||
virtual at 0
|
||||
SRV SRV
|
||||
end virtual
|
||||
|
||||
virtual at 0
|
||||
CFH COFF_HEADER
|
||||
end virtual
|
||||
|
||||
virtual at 0
|
||||
CFS COFF_SECTION
|
||||
end virtual
|
||||
|
||||
virtual at 0
|
||||
CRELOC COFF_RELOC
|
||||
end virtual
|
||||
|
||||
virtual at 0
|
||||
CSYM COFF_SYM
|
||||
end virtual
|
||||
|
@ -1,507 +0,0 @@
|
||||
$Revision: 431 $
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
; diamond, 2006
|
||||
sys_debug_services:
|
||||
cmp eax, 9
|
||||
ja @f
|
||||
jmp dword [sys_debug_services_table+eax*4]
|
||||
@@: ret
|
||||
sys_debug_services_table:
|
||||
dd debug_set_event_data
|
||||
dd debug_getcontext
|
||||
dd debug_setcontext
|
||||
dd debug_detach
|
||||
dd debug_suspend
|
||||
dd debug_resume
|
||||
dd debug_read_process_memory
|
||||
dd debug_write_process_memory
|
||||
dd debug_terminate
|
||||
dd debug_set_drx
|
||||
|
||||
debug_set_event_data:
|
||||
; in: ebx = pointer
|
||||
; destroys eax
|
||||
mov eax, [CURRENT_TASK]
|
||||
shl eax, 8
|
||||
mov [eax+SLOT_BASE+APPDATA.dbg_event_mem], ebx
|
||||
ret
|
||||
|
||||
get_debuggee_slot:
|
||||
; in: ebx=PID
|
||||
; out: CF=1 if error
|
||||
; CF=0 and eax=slot*0x20 if ok
|
||||
; out: interrupts disabled
|
||||
cli
|
||||
mov eax, ebx
|
||||
call pid_to_slot
|
||||
test eax, eax
|
||||
jz .ret_bad
|
||||
shl eax, 5
|
||||
push ebx
|
||||
mov ebx, [CURRENT_TASK]
|
||||
cmp [SLOT_BASE+eax*8+APPDATA.debugger_slot], ebx
|
||||
pop ebx
|
||||
jnz .ret_bad
|
||||
; clc ; automatically
|
||||
ret
|
||||
.ret_bad:
|
||||
stc
|
||||
ret
|
||||
|
||||
debug_detach:
|
||||
; in: ebx=pid
|
||||
; destroys eax,ebx
|
||||
call get_debuggee_slot
|
||||
jc .ret
|
||||
and dword [eax*8+SLOT_BASE+APPDATA.debugger_slot], 0
|
||||
call do_resume
|
||||
.ret:
|
||||
sti
|
||||
ret
|
||||
|
||||
debug_terminate:
|
||||
; in: ebx=pid
|
||||
call get_debuggee_slot
|
||||
jc debug_detach.ret
|
||||
mov ebx, eax
|
||||
shr ebx, 5
|
||||
push 2
|
||||
pop eax
|
||||
jmp sys_system
|
||||
|
||||
debug_suspend:
|
||||
; in: ebx=pid
|
||||
; destroys eax,ebx
|
||||
call get_debuggee_slot
|
||||
jc .ret
|
||||
mov bl, [CURRENT_TASK+eax+TASKDATA.state] ; process state
|
||||
test bl, bl
|
||||
jz .1
|
||||
cmp bl, 5
|
||||
jnz .ret
|
||||
mov bl, 2
|
||||
.2: mov [CURRENT_TASK+eax+TASKDATA.state], bl
|
||||
.ret:
|
||||
sti
|
||||
ret
|
||||
.1:
|
||||
inc ebx
|
||||
jmp .2
|
||||
|
||||
do_resume:
|
||||
mov bl, [CURRENT_TASK+eax+TASKDATA.state]
|
||||
cmp bl, 1
|
||||
jz .1
|
||||
cmp bl, 2
|
||||
jnz .ret
|
||||
mov bl, 5
|
||||
.2: mov [CURRENT_TASK+eax+TASKDATA.state], bl
|
||||
.ret: ret
|
||||
.1: dec ebx
|
||||
jmp .2
|
||||
|
||||
debug_resume:
|
||||
; in: ebx=pid
|
||||
; destroys eax,ebx
|
||||
call get_debuggee_slot
|
||||
jc .ret
|
||||
call do_resume
|
||||
.ret: sti
|
||||
ret
|
||||
|
||||
debug_getcontext:
|
||||
; in:
|
||||
; ebx=pid
|
||||
; ecx=sizeof(CONTEXT)
|
||||
; edx->CONTEXT
|
||||
; destroys eax,ecx,edx,esi,edi
|
||||
cmp ecx, 28h
|
||||
jnz .ret
|
||||
add edx, std_application_base_address
|
||||
push ebx
|
||||
mov ebx, edx
|
||||
call check_region
|
||||
pop ebx
|
||||
dec eax
|
||||
jnz .ret
|
||||
call get_debuggee_slot
|
||||
jc .ret
|
||||
imul eax, tss_step/32
|
||||
add eax, tss_data
|
||||
mov edi, edx
|
||||
cmp [eax+TSS._cs], app_code
|
||||
jnz .ring0
|
||||
lea esi, [eax+TSS._eip]
|
||||
shr ecx, 2
|
||||
rep movsd
|
||||
jmp .ret
|
||||
.ring0:
|
||||
; note that following code assumes that all interrupt/exception handlers
|
||||
; saves ring-3 context by push ds es, pushad in this order
|
||||
mov esi, [eax+TSS._esp0]
|
||||
; top of ring0 stack: ring3 stack ptr (ss+esp), iret data (cs+eip+eflags), ds, es, pushad
|
||||
sub esi, 8+12+8+20h
|
||||
lodsd
|
||||
mov [edi+24h], eax
|
||||
lodsd
|
||||
mov [edi+20h], eax
|
||||
lodsd
|
||||
mov [edi+1Ch], eax
|
||||
lodsd
|
||||
lodsd
|
||||
mov [edi+14h], eax
|
||||
lodsd
|
||||
mov [edi+10h], eax
|
||||
lodsd
|
||||
mov [edi+0Ch], eax
|
||||
lodsd
|
||||
mov [edi+8], eax
|
||||
add esi, 8
|
||||
lodsd
|
||||
mov [edi], eax
|
||||
lodsd
|
||||
lodsd
|
||||
mov [edi+4], eax
|
||||
lodsd
|
||||
mov [edi+18h], eax
|
||||
.ret:
|
||||
sti
|
||||
ret
|
||||
|
||||
debug_setcontext:
|
||||
; in:
|
||||
; ebx=pid
|
||||
; ecx=sizeof(CONTEXT)
|
||||
; edx->CONTEXT
|
||||
; destroys eax,ecx,edx,esi,edi
|
||||
cmp ecx, 28h
|
||||
jnz .ret
|
||||
add edx, std_application_base_address
|
||||
push ebx
|
||||
mov ebx, edx
|
||||
call check_region
|
||||
pop ebx
|
||||
dec eax
|
||||
jnz .ret
|
||||
call get_debuggee_slot
|
||||
jc .stiret
|
||||
imul eax, tss_step/32
|
||||
add eax, tss_data
|
||||
mov esi, edx
|
||||
cmp [eax+TSS._cs], app_code
|
||||
jnz .ring0
|
||||
lea edi, [eax+TSS._eip]
|
||||
shr ecx, 2
|
||||
rep movsd
|
||||
jmp .stiret
|
||||
.ring0:
|
||||
mov edi, [eax+TSS._esp0]
|
||||
sub edi, 8+12+8+20h
|
||||
mov eax, [esi+24h]
|
||||
stosd
|
||||
mov eax, [esi+20h]
|
||||
stosd
|
||||
mov eax, [esi+1Ch]
|
||||
stosd
|
||||
scasd
|
||||
mov eax, [esi+14h]
|
||||
stosd
|
||||
mov eax, [esi+10h]
|
||||
stosd
|
||||
mov eax, [esi+0Ch]
|
||||
stosd
|
||||
mov eax, [esi+8]
|
||||
stosd
|
||||
add edi, 8
|
||||
mov eax, [esi]
|
||||
stosd
|
||||
scasd
|
||||
mov eax, [esi+4]
|
||||
stosd
|
||||
mov eax, [esi+18h]
|
||||
stosd
|
||||
.stiret:
|
||||
sti
|
||||
.ret:
|
||||
ret
|
||||
|
||||
debug_set_drx:
|
||||
call get_debuggee_slot
|
||||
jc .errret
|
||||
mov ebp, eax
|
||||
lea eax, [eax*8+SLOT_BASE+APPDATA.dbg_regs]
|
||||
; [eax]=dr0, [eax+4]=dr1, [eax+8]=dr2, [eax+C]=dr3
|
||||
; [eax+10]=dr7
|
||||
add edx, std_application_base_address
|
||||
jc .errret
|
||||
cmp cl, 3
|
||||
ja .errret
|
||||
mov ebx, dr7
|
||||
shr ebx, cl
|
||||
shr ebx, cl
|
||||
test ebx, 2 ; bit 1+2*index = G0..G3, global break enable
|
||||
jnz .errret2
|
||||
test ch, ch
|
||||
jns .new
|
||||
; clear breakpoint
|
||||
movzx ecx, cl
|
||||
add ecx, ecx
|
||||
and dword [eax+ecx*2], 0 ; clear DR<i>
|
||||
btr dword [eax+10h], ecx ; clear L<i> bit
|
||||
test byte [eax+10h], 55h
|
||||
jnz .okret
|
||||
imul eax, ebp, tss_step/32
|
||||
and byte [eax + tss_data + TSS._trap], not 1
|
||||
.okret:
|
||||
and dword [esp+36], 0
|
||||
sti
|
||||
ret
|
||||
.errret:
|
||||
sti
|
||||
mov dword [esp+36], 1
|
||||
ret
|
||||
.errret2:
|
||||
sti
|
||||
mov dword [esp+36], 2
|
||||
ret
|
||||
.new:
|
||||
; add new breakpoint
|
||||
; cl=index; ch=flags; edx=address
|
||||
test ch, 0xF0
|
||||
jnz .errret
|
||||
mov bl, ch
|
||||
and bl, 3
|
||||
cmp bl, 2
|
||||
jz .errret
|
||||
mov bl, ch
|
||||
shr bl, 2
|
||||
cmp bl, 2
|
||||
jz .errret
|
||||
test dl, bl
|
||||
jnz .errret
|
||||
or byte [eax+10h+1], 3 ; set GE and LE flags
|
||||
movzx ebx, ch
|
||||
movzx ecx, cl
|
||||
add ecx, ecx
|
||||
bts dword [eax+10h], ecx ; set L<i> flag
|
||||
add ecx, ecx
|
||||
mov [eax+ecx], edx ; set DR<i>
|
||||
shl ebx, cl
|
||||
mov edx, 0xF
|
||||
shl edx, cl
|
||||
not edx
|
||||
and [eax+10h+2], dx
|
||||
or [eax+10h+2], bx ; set R/W and LEN fields
|
||||
imul eax, ebp, tss_step/32
|
||||
or byte [eax + tss_data + TSS._trap], 1
|
||||
jmp .okret
|
||||
|
||||
debug_read_process_memory:
|
||||
; in:
|
||||
; ebx=pid
|
||||
; ecx=length
|
||||
; esi->buffer in debugger
|
||||
; edx=address in debuggee
|
||||
; out: [esp+36]=sizeof(read)
|
||||
; destroys all
|
||||
add esi, std_application_base_address
|
||||
push ebx
|
||||
mov ebx, esi
|
||||
call check_region
|
||||
pop ebx
|
||||
dec eax
|
||||
jnz .err
|
||||
call get_debuggee_slot
|
||||
jc .err
|
||||
shr eax, 5
|
||||
mov ebx, esi
|
||||
call read_process_memory
|
||||
sti
|
||||
mov dword [esp+36], eax
|
||||
ret
|
||||
.err:
|
||||
or dword [esp+36], -1
|
||||
ret
|
||||
|
||||
debug_write_process_memory:
|
||||
; in:
|
||||
; ebx=pid
|
||||
; ecx=length
|
||||
; esi->buffer in debugger
|
||||
; edx=address in debuggee
|
||||
; out: [esp+36]=sizeof(write)
|
||||
; destroys all
|
||||
add esi, std_application_base_address
|
||||
push ebx
|
||||
mov ebx, esi
|
||||
call check_region
|
||||
pop ebx
|
||||
dec eax
|
||||
jnz debug_read_process_memory.err
|
||||
call get_debuggee_slot
|
||||
jc debug_read_process_memory.err
|
||||
shr eax, 5
|
||||
mov ebx, esi
|
||||
call write_process_memory
|
||||
sti
|
||||
mov [esp+36], eax
|
||||
ret
|
||||
|
||||
debugger_notify:
|
||||
; in: eax=debugger slot
|
||||
; ecx=size of debug message
|
||||
; [esp+4]..[esp+4+ecx]=message
|
||||
; interrupts must be disabled!
|
||||
; destroys all general registers
|
||||
; interrupts remain disabled
|
||||
xchg ebp, eax
|
||||
mov edi, [timer_ticks]
|
||||
add edi, 500 ; 5 sec timeout
|
||||
.1:
|
||||
mov eax, ebp
|
||||
shl eax, 8
|
||||
mov edx, [SLOT_BASE+eax+APPDATA.dbg_event_mem]
|
||||
test edx, edx
|
||||
jz .ret
|
||||
; read buffer header
|
||||
push ecx
|
||||
push eax
|
||||
push eax
|
||||
mov eax, ebp
|
||||
mov ebx, esp
|
||||
mov ecx, 8
|
||||
call read_process_memory
|
||||
cmp eax, ecx
|
||||
jz @f
|
||||
add esp, 12
|
||||
jmp .ret
|
||||
@@:
|
||||
cmp dword [ebx], 0
|
||||
jg @f
|
||||
.2:
|
||||
pop ecx
|
||||
pop ecx
|
||||
pop ecx
|
||||
cmp dword [CURRENT_TASK], 1
|
||||
jnz .notos
|
||||
cmp [timer_ticks], edi
|
||||
jae .ret
|
||||
.notos:
|
||||
sti
|
||||
call change_task
|
||||
cli
|
||||
jmp .1
|
||||
@@:
|
||||
mov ecx, [ebx+8]
|
||||
add ecx, [ebx+4]
|
||||
cmp ecx, [ebx]
|
||||
ja .2
|
||||
; advance buffer position
|
||||
push ecx
|
||||
mov ecx, 4
|
||||
sub ebx, ecx
|
||||
mov eax, ebp
|
||||
add edx, ecx
|
||||
call write_process_memory
|
||||
pop eax
|
||||
; write message
|
||||
mov eax, ebp
|
||||
add edx, ecx
|
||||
add edx, [ebx+8]
|
||||
add ebx, 20
|
||||
pop ecx
|
||||
pop ecx
|
||||
pop ecx
|
||||
call write_process_memory
|
||||
; new debug event
|
||||
mov eax, ebp
|
||||
shl eax, 8
|
||||
or byte [SLOT_BASE+eax+APPDATA.event_mask+1], 1 ; set flag 100h
|
||||
.ret:
|
||||
ret
|
||||
|
||||
debug_exc:
|
||||
; int 1 = #DB
|
||||
save_ring3_context
|
||||
cld
|
||||
mov ax, os_data
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
mov eax, dr6
|
||||
test ax, ax
|
||||
jns @f
|
||||
; this is exception from task switch
|
||||
; set DRx registers for task and continue
|
||||
mov eax, [CURRENT_TASK]
|
||||
shl eax, 8
|
||||
add eax, SLOT_BASE+APPDATA.dbg_regs
|
||||
mov ecx, [eax+0]
|
||||
mov dr0, ecx
|
||||
mov ecx, [eax+4]
|
||||
mov dr1, ecx
|
||||
mov ecx, [eax+8]
|
||||
mov dr2, ecx
|
||||
mov ecx, [eax+0Ch]
|
||||
mov dr3, ecx
|
||||
xor ecx, ecx
|
||||
mov dr6, ecx
|
||||
mov ecx, [eax+10h]
|
||||
mov dr7, ecx
|
||||
restore_ring3_context
|
||||
iretd
|
||||
@@:
|
||||
push eax
|
||||
xor eax, eax
|
||||
mov dr6, eax
|
||||
; test if debugging
|
||||
cli
|
||||
mov eax, [CURRENT_TASK]
|
||||
shl eax, 8
|
||||
mov eax, [SLOT_BASE+eax+APPDATA.debugger_slot]
|
||||
test eax, eax
|
||||
jnz .debug
|
||||
sti
|
||||
; not debuggee => say error and terminate
|
||||
add esp, 28h+4
|
||||
mov [error_interrupt], 1
|
||||
call show_error_parameters
|
||||
mov edx, [TASK_BASE]
|
||||
mov byte [edx+TASKDATA.state], 4
|
||||
jmp change_task
|
||||
.debug:
|
||||
; we are debugged process, notify debugger and suspend ourself
|
||||
; eax=debugger PID
|
||||
pop edx
|
||||
mov ebx, dr7
|
||||
mov cl, not 1
|
||||
.l1:
|
||||
test bl, 1
|
||||
jnz @f
|
||||
and dl, cl
|
||||
@@:
|
||||
shr ebx, 2
|
||||
add cl, cl
|
||||
inc ecx
|
||||
cmp cl, not 10h
|
||||
jnz .l1
|
||||
push edx ; DR6 image
|
||||
mov ecx, [TASK_BASE]
|
||||
push dword [ecx+TASKDATA.pid] ; PID
|
||||
push 12
|
||||
pop ecx
|
||||
push 3 ; 3 = debug exception
|
||||
call debugger_notify
|
||||
pop ecx
|
||||
pop ecx
|
||||
pop ecx
|
||||
mov edx, [TASK_BASE]
|
||||
mov byte [edx+TASKDATA.state], 1 ; suspended
|
||||
call change_task
|
||||
restore_ring3_context
|
||||
iretd
|
@ -1,143 +0,0 @@
|
||||
$Revision: 431 $
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;**************************************************
|
||||
;* ÏÎÈÑÊ ÌÛØÈ ÏÎ ÏÎÑËÅÄÎÂÀÒÅËÜÍÛÌ ÏÎÐÒÀÌ *
|
||||
;* Ïðîöåäóðà ïîäãîòàâëèâàåò ãëîáàëüíûå ïåðåìåííûå *
|
||||
;* COMPortNum è COMPortBaseAddr äëÿ ïîäïðîãðàììû *
|
||||
;* óñòàíîâêè îáðàáîò÷èêà ïðåðûâàíèÿ *
|
||||
;**************************************************
|
||||
; Àâòîð èñõîäíîãî òåêñòà Êóëàêîâ Âëàäèìèð Ãåííàäüåâè÷.
|
||||
; Àäàïòàöèÿ è äîðàáîòêà Mario79
|
||||
|
||||
Detect_COM_Mouse:
|
||||
pusha
|
||||
call MSMouseSearch
|
||||
cmp AL,'M'
|
||||
jne @f
|
||||
mov [com1_mouse_detected],1
|
||||
pusha
|
||||
|
||||
mov eax,4
|
||||
shl eax,2
|
||||
mov [irq_owner+eax],byte 1
|
||||
|
||||
inc dword [RESERVED_PORTS]
|
||||
mov edi,[RESERVED_PORTS]
|
||||
shl edi,4
|
||||
mov [RESERVED_PORTS+edi+0],dword 1
|
||||
mov [RESERVED_PORTS+edi+4],dword 0x3f0
|
||||
mov [RESERVED_PORTS+edi+8],dword 0x3ff
|
||||
|
||||
popa
|
||||
mov esi,boot_setmouse_type+22
|
||||
call boot_log
|
||||
@@:
|
||||
sub [COMPortBaseAddr],100h
|
||||
call MSMouseSearch
|
||||
cmp AL,'M'
|
||||
jne @f
|
||||
mov [com2_mouse_detected],1
|
||||
pusha
|
||||
|
||||
mov eax,3
|
||||
shl eax,2
|
||||
mov [irq_owner+eax],byte 1
|
||||
|
||||
inc dword [RESERVED_PORTS]
|
||||
mov edi,[RESERVED_PORTS]
|
||||
shl edi,4
|
||||
mov [RESERVED_PORTS+edi+0],dword 1
|
||||
mov [RESERVED_PORTS+edi+4],dword 0x2f0
|
||||
mov [RESERVED_PORTS+edi+8],dword 0x2ff
|
||||
|
||||
popa
|
||||
mov esi,boot_setmouse_type+44
|
||||
call boot_log
|
||||
@@:
|
||||
popa
|
||||
jmp end_detecting_mouse
|
||||
|
||||
MSMouseSearch:
|
||||
; ÏÎÈÑÊ ÌÛØÈ ×ÅÐÅÇ COM-ÏÎÐÒÛ
|
||||
MouseSearch:
|
||||
; Óñòàíàâëèâàåì ñêîðîñòü
|
||||
; ïðèåìà/ïåðåäà÷è 1200 áîä
|
||||
mov DX,[COMPortBaseAddr]
|
||||
add DX,3
|
||||
in AL,DX
|
||||
or AL,80h ;óñòàíîâèòü áèò DLAB
|
||||
out DX,AL
|
||||
mov DX,[COMPortBaseAddr]
|
||||
mov AL,60h ;1200 áîä
|
||||
out DX,AL
|
||||
inc DX
|
||||
mov AL,0
|
||||
out DX,AL
|
||||
; Óñòàíîâèòü äëèíó ñëîâà 7 áèò, 1 ñòîïîâûé áèò,
|
||||
; ÷åòíîñòü íå êîíòðîëèðîâàòü
|
||||
mov DX,[COMPortBaseAddr]
|
||||
add DX,3
|
||||
mov AL,00000010b
|
||||
out DX,AL
|
||||
; Çàïðåòèòü âñå ïðåðûâàíè
|
||||
mov DX,[COMPortBaseAddr]
|
||||
inc DX
|
||||
mov AL,0
|
||||
out DX,AL
|
||||
; Ïðîâåðèòü, ÷òî óñòðîéñòâî ïîäêëþ÷åíî è ÿâëÿåòñ
|
||||
; ìûøüþ òèïà MSMouse
|
||||
; Îòêëþ÷èòü ïèòàíèå ìûøè è ïðåðûâàíè
|
||||
mov DX,[COMPortBaseAddr]
|
||||
add DX,4 ;ðåãèñòð óïðàâëåíèÿ ìîäåìîì
|
||||
mov AL,0 ;ñáðîñèòü DTR, RTS è OUT2
|
||||
out DX,AL
|
||||
; Îæèäàòü 5 "òèêîâ" (0,2 ñ)
|
||||
mov ecx,0xffff
|
||||
dT_1:
|
||||
dec ecx
|
||||
cmp ecx,0
|
||||
jne dT_1
|
||||
mov ecx,0xffff
|
||||
; Âêëþ÷èòü ïèòàíèå ìûøè
|
||||
mov AL,11b ;óñòàíîâèòü DTR è RTS
|
||||
out DX,AL
|
||||
; Î÷èñòèòü ðåãèñòð äàííûõ
|
||||
mov DX,[COMPortBaseAddr]
|
||||
in AL,DX
|
||||
; Öèêë îïðîñà ïîðòà
|
||||
WaitData:
|
||||
; Îæèäàòü åùå 10 "òèêîâ"
|
||||
dec ecx
|
||||
cmp ecx,0
|
||||
je NoMouse
|
||||
; Ïðîâåðèòü íàëè÷èå èäåíòèôèêàöèîííîãî áàéòà
|
||||
mov DX,[COMPortBaseAddr]
|
||||
add DX,5
|
||||
in AL,DX
|
||||
test AL,1 ;Äàííûå ãîòîâû?
|
||||
jz WaitData
|
||||
; Ââåñòè äàííûå
|
||||
mov DX,[COMPortBaseAddr]
|
||||
in AL,DX
|
||||
NoMouse:
|
||||
ret
|
||||
|
||||
iglobal
|
||||
COMPortBaseAddr dw 3F8h
|
||||
;COMPortNum dw 0
|
||||
endg
|
||||
|
||||
iglobal
|
||||
boot_setmouse_type db 'Detected - PS2 mouse',0
|
||||
db 'Detected - COM1 mouse',0
|
||||
db 'Detected - COM2 mouse',0
|
||||
endg
|
||||
|
||||
end_detecting_mouse:
|
||||
|
@ -1,139 +0,0 @@
|
||||
$Revision: 431 $
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
MouseSearch_PS2:
|
||||
jmp MouseSearch_PS2_begin
|
||||
|
||||
mouse_error equ MouseSearch_PS2_begin.error
|
||||
|
||||
kb_cmd_c:
|
||||
call kb_cmd
|
||||
jmp check_kbd
|
||||
|
||||
kb_write_c:
|
||||
call kb_write
|
||||
jmp check_kbd
|
||||
|
||||
kb_read_c:
|
||||
call kb_read
|
||||
;jmp check_kbd
|
||||
|
||||
check_kbd:
|
||||
cmp ah, 1
|
||||
je mouse_error
|
||||
ret
|
||||
|
||||
uglobal
|
||||
mouse_cmd_byte db 0
|
||||
mouse_nr_tries db 0
|
||||
mouse_nr_resends db 0
|
||||
|
||||
mouse_error_esp dd 0
|
||||
endg
|
||||
|
||||
|
||||
mouse_cmd:
|
||||
mov [mouse_cmd_byte], al
|
||||
mov [mouse_nr_resends], 5
|
||||
.resend:
|
||||
mov bl, 0xd4
|
||||
call kb_cmd_c
|
||||
mov al, [mouse_cmd_byte]
|
||||
call kb_write_c
|
||||
|
||||
call mouse_read
|
||||
|
||||
cmp al, 0xFA ; ack
|
||||
jne .noack
|
||||
ret
|
||||
.noack:
|
||||
cmp al, 0xFE ; resend
|
||||
jne .noresend
|
||||
dec [mouse_nr_resends]
|
||||
jnz .resend
|
||||
.noresend:
|
||||
jmp mouse_error
|
||||
|
||||
|
||||
mouse_read:
|
||||
mov [mouse_nr_tries], 100
|
||||
.repeat:
|
||||
call kb_read
|
||||
cmp ah, 1
|
||||
jne .fin
|
||||
mov esi, 10
|
||||
call delay_ms
|
||||
dec [mouse_nr_tries]
|
||||
jnz .repeat
|
||||
jmp mouse_error
|
||||
.fin:
|
||||
ret
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
MouseSearch_PS2_begin:
|
||||
pushad
|
||||
|
||||
mov [mouse_error_esp], esp
|
||||
|
||||
mov bl, 0xAD ; disable keyboard interface
|
||||
call kb_cmd_c
|
||||
|
||||
mov bl, 0xA8 ; enable mouse interface
|
||||
call kb_cmd_c
|
||||
|
||||
mov al, 0xFF ; reset
|
||||
call mouse_cmd
|
||||
|
||||
; now the mouse is in Reset Mode
|
||||
; get the Basic Assurance Test completion code
|
||||
call mouse_read
|
||||
cmp al, 0xAA
|
||||
jne .error ; dead mouse
|
||||
|
||||
; get device ID
|
||||
call mouse_read
|
||||
cmp al, 0x00
|
||||
jne .error ; unknown device
|
||||
|
||||
; reset completed successfully
|
||||
|
||||
; enable mouse interrupt - IRQ12
|
||||
mov bl, 0x20 ; read command byte
|
||||
call kb_cmd_c
|
||||
call kb_read_c
|
||||
or al, 10b
|
||||
push eax
|
||||
mov bl, 0x60 ; write command byte
|
||||
call kb_cmd_c
|
||||
pop eax
|
||||
call kb_write_c
|
||||
|
||||
mov al, 0xF4 ; enable data reporting
|
||||
call mouse_cmd
|
||||
|
||||
mov [ps2_mouse_detected], 1
|
||||
mov bl, 0xAE ; enable keyboard interface
|
||||
call kb_cmd
|
||||
|
||||
mov esi, boot_setmouse_type
|
||||
call boot_log
|
||||
|
||||
jmp .finish
|
||||
|
||||
|
||||
.error:
|
||||
mov esp, [mouse_error_esp] ; clear stack frame
|
||||
mov [ps2_mouse_detected], 0
|
||||
mov bl, 0xA7 ; disable mouse interface
|
||||
call kb_cmd
|
||||
mov bl, 0xAE ; enable keyboard interface
|
||||
call kb_cmd
|
||||
|
||||
.finish:
|
||||
popad
|
File diff suppressed because it is too large
Load Diff
@ -1,117 +0,0 @@
|
||||
$Revision: 431 $
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
iglobal
|
||||
szKernel db 'KERNEL', 0
|
||||
szVersion db 'version',0
|
||||
|
||||
szRegService db 'RegService',0
|
||||
szGetService db 'GetService',0
|
||||
szServiceHandler db 'ServiceHandler',0
|
||||
szAttachIntHandler db 'AttachIntHandler',0
|
||||
szFpuSave db 'FpuSave',0
|
||||
szFpuRestore db 'FpuRestore',0
|
||||
|
||||
szPciApi db 'PciApi', 0
|
||||
szPciRead32 db 'PciRead32', 0
|
||||
szPciRead8 db 'PciRead8', 0
|
||||
szPciWrite8 db 'PciWrite8',0
|
||||
|
||||
szAllocPage db 'AllocPage',0
|
||||
szAllocPages db 'AllocPages',0
|
||||
szFreePage db 'FreePage',0
|
||||
szGetPgAddr db 'GetPgAddr',0
|
||||
szMapPage db 'MapPage',0
|
||||
szMapSpace db 'MapSpace',0
|
||||
szCommitPages db 'CommitPages',0
|
||||
szReleasePages db 'ReleasePages',0
|
||||
|
||||
szAllocKernelSpace db 'AllocKernelSpace',0
|
||||
szFreeKernelSpace db 'FreeKernelSpace',0
|
||||
szKernelAlloc db 'KernelAlloc',0
|
||||
szKernelFree db 'KernelFree',0
|
||||
szUserAlloc db 'UserAlloc',0
|
||||
szUserFree db 'UserFree',0
|
||||
szKmalloc db 'Kmalloc',0
|
||||
szKfree db 'Kfree',0
|
||||
|
||||
szCreateObject db 'CreateObject',0
|
||||
szDestroyObject db 'DestroyObject',0
|
||||
szCreateEvent db 'CreateEvent',0
|
||||
szRaiseEvent db 'RaiseEvent',0
|
||||
szWaitEvent db 'WaitEvent',0
|
||||
szDestroyEvent db 'DestroyEvent',0
|
||||
szClearEvent db 'ClearEvent',0
|
||||
|
||||
szLoadCursor db 'LoadCursor',0
|
||||
szSetHwCursor db 'SetHwCursor',0
|
||||
szHwCursorRestore db 'HwCursorRestore', 0
|
||||
szHwCursorCreate db 'HwCursorCreate', 0
|
||||
|
||||
szSysMsgBoardStr db 'SysMsgBoardStr', 0
|
||||
szGetCurrentTask db 'GetCurrentTask',0
|
||||
szLFBAddress db 'LFBAddress',0
|
||||
szLoadFile db 'LoadFile',0
|
||||
szSendEvent db 'SendEvent',0
|
||||
|
||||
|
||||
align 16
|
||||
kernel_export:
|
||||
dd szRegService , reg_service
|
||||
dd szGetService , get_service
|
||||
dd szServiceHandler , srv_handler
|
||||
dd szAttachIntHandler, attach_int_handler
|
||||
dd szFpuSave , fpu_save
|
||||
dd szFpuRestore , fpu_restore
|
||||
|
||||
dd szPciApi , pci_api
|
||||
dd szPciRead32 , pci_read32
|
||||
dd szPciRead8 , pci_read8
|
||||
dd szPciWrite8 , pci_write8
|
||||
|
||||
dd szAllocPage , alloc_page
|
||||
dd szAllocPages , alloc_pages
|
||||
dd szFreePage , free_page
|
||||
dd szMapPage , map_page
|
||||
dd szMapSpace , map_space
|
||||
dd szGetPgAddr , get_pg_addr
|
||||
dd szCommitPages , commit_pages ;not implemented
|
||||
dd szReleasePages , release_pages
|
||||
|
||||
dd szAllocKernelSpace, alloc_kernel_space
|
||||
dd szFreeKernelSpace , free_kernel_space
|
||||
dd szKernelAlloc , kernel_alloc
|
||||
dd szKernelFree , kernel_free
|
||||
dd szUserAlloc , user_alloc
|
||||
dd szUserFree , user_free
|
||||
dd szKmalloc , malloc
|
||||
dd szKfree , free
|
||||
|
||||
dd szCreateObject , create_kernel_object
|
||||
dd szDestroyObject , destroy_kernel_object
|
||||
dd szCreateEvent , create_event
|
||||
dd szRaiseEvent , raise_event
|
||||
dd szWaitEvent , wait_event
|
||||
dd szDestroyEvent , destroy_event
|
||||
dd szClearEvent , clear_event
|
||||
|
||||
dd szLoadCursor , load_cursor
|
||||
dd szSetHwCursor , set_hw_cursor
|
||||
dd szHwCursorRestore , hw_restore
|
||||
dd szHwCursorCreate , create_cursor
|
||||
|
||||
dd szSysMsgBoardStr , sys_msg_board_str
|
||||
dd szGetCurrentTask , get_curr_task
|
||||
dd szLoadFile , load_file
|
||||
dd szSendEvent , send_event
|
||||
exp_lfb:
|
||||
dd szLFBAddress , 0
|
||||
dd 0
|
||||
|
||||
endg
|
||||
|
@ -1,283 +0,0 @@
|
||||
$Revision: 435 $
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
init_fpu:
|
||||
clts
|
||||
fninit
|
||||
|
||||
bt [cpu_caps], CAPS_SSE
|
||||
jnc .no_SSE
|
||||
|
||||
mov ebx, cr4
|
||||
mov ecx, cr0
|
||||
or ebx, CR4_OSFXSR+CR4_OSXMMEXPT
|
||||
mov cr4, ebx
|
||||
|
||||
and ecx, not (CR0_MP+CR0_EM)
|
||||
or ecx, CR0_NE
|
||||
mov cr0, ecx
|
||||
|
||||
mov dword [esp-4], SSE_INIT
|
||||
ldmxcsr [esp-4]
|
||||
|
||||
xorps xmm0, xmm0
|
||||
xorps xmm1, xmm1
|
||||
xorps xmm2, xmm2
|
||||
xorps xmm3, xmm3
|
||||
xorps xmm4, xmm4
|
||||
xorps xmm5, xmm5
|
||||
xorps xmm6, xmm6
|
||||
xorps xmm7, xmm7
|
||||
fxsave [fpu_data] ;[eax]
|
||||
ret
|
||||
.no_SSE:
|
||||
mov ecx, cr0
|
||||
and ecx, not CR0_EM
|
||||
or ecx, CR0_MP+CR0_NE
|
||||
mov cr0, ecx
|
||||
fnsave [fpu_data]
|
||||
ret
|
||||
|
||||
; param
|
||||
; eax= 512 bytes memory area
|
||||
|
||||
align 4
|
||||
fpu_save:
|
||||
push ecx
|
||||
push esi
|
||||
push edi
|
||||
|
||||
pushfd
|
||||
cli
|
||||
|
||||
clts
|
||||
mov edi, eax
|
||||
|
||||
mov ecx, [fpu_owner]
|
||||
mov esi, [CURRENT_TASK]
|
||||
cmp ecx, esi
|
||||
jne .save
|
||||
|
||||
call save_context
|
||||
jmp .exit
|
||||
.save:
|
||||
mov [fpu_owner], esi
|
||||
|
||||
shl ecx, 8
|
||||
mov eax, [ecx+SLOT_BASE+APPDATA.fpu_state]
|
||||
|
||||
call save_context
|
||||
|
||||
shl esi, 8
|
||||
mov esi, [esi+SLOT_BASE+APPDATA.fpu_state]
|
||||
mov ecx, 512/4
|
||||
cld
|
||||
rep movsd
|
||||
fninit
|
||||
.exit:
|
||||
popfd
|
||||
pop edi
|
||||
pop esi
|
||||
pop ecx
|
||||
ret
|
||||
|
||||
align 4
|
||||
save_context:
|
||||
bt [cpu_caps], CAPS_SSE
|
||||
jnc .no_SSE
|
||||
|
||||
fxsave [eax]
|
||||
ret
|
||||
.no_SSE:
|
||||
fnsave [eax]
|
||||
ret
|
||||
|
||||
align 4
|
||||
fpu_restore:
|
||||
push ecx
|
||||
push esi
|
||||
|
||||
mov esi, eax
|
||||
|
||||
pushfd
|
||||
cli
|
||||
|
||||
mov ecx, [fpu_owner]
|
||||
mov eax, [CURRENT_TASK]
|
||||
cmp ecx, eax
|
||||
jne .copy
|
||||
|
||||
clts
|
||||
bt [cpu_caps], CAPS_SSE
|
||||
jnc .no_SSE
|
||||
|
||||
fxrstor [esi]
|
||||
popfd
|
||||
pop esi
|
||||
pop ecx
|
||||
ret
|
||||
.no_SSE:
|
||||
fnclex ;fix possible problems
|
||||
frstor [esi]
|
||||
popfd
|
||||
pop esi
|
||||
pop ecx
|
||||
ret
|
||||
.copy:
|
||||
shl eax, 8
|
||||
mov edi, [eax+SLOT_BASE+APPDATA.fpu_state]
|
||||
mov ecx, 512/4
|
||||
cld
|
||||
rep movsd
|
||||
popfd
|
||||
pop esi
|
||||
pop ecx
|
||||
ret
|
||||
|
||||
align 4
|
||||
e7: ;#NM exception handler
|
||||
save_ring3_context
|
||||
clts
|
||||
mov ax, os_data
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
|
||||
mov ebx, [fpu_owner]
|
||||
cmp ebx, [CURRENT_TASK]
|
||||
je .exit
|
||||
|
||||
shl ebx, 8
|
||||
mov eax, [ebx+SLOT_BASE+APPDATA.fpu_state]
|
||||
bt [cpu_caps], CAPS_SSE
|
||||
jnc .no_SSE
|
||||
|
||||
fxsave [eax]
|
||||
mov ebx, [CURRENT_TASK]
|
||||
mov [fpu_owner], ebx
|
||||
shl ebx, 8
|
||||
mov eax, [ebx+SLOT_BASE+APPDATA.fpu_state]
|
||||
fxrstor [eax]
|
||||
.exit:
|
||||
restore_ring3_context
|
||||
iret
|
||||
|
||||
.no_SSE:
|
||||
fnsave [eax]
|
||||
mov ebx, [CURRENT_TASK]
|
||||
mov [fpu_owner], ebx
|
||||
shl ebx, 8
|
||||
mov eax, [ebx+SLOT_BASE+APPDATA.fpu_state]
|
||||
frstor [eax]
|
||||
restore_ring3_context
|
||||
iret
|
||||
|
||||
iglobal
|
||||
fpu_owner dd 1
|
||||
endg
|
||||
|
||||
reg_eip equ ebp+4
|
||||
reg_cs equ ebp+8
|
||||
reg_eflags equ ebp+12
|
||||
reg_esp equ ebp+16
|
||||
reg_ss equ ebp+20
|
||||
|
||||
align 4
|
||||
except_16: ;fpu native exceptions handler
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
|
||||
push eax
|
||||
push ebx
|
||||
push ecx
|
||||
push edx
|
||||
|
||||
mov ebx, [ss:CURRENT_TASK]
|
||||
shl ebx, 8
|
||||
|
||||
mov eax, [ss:ebx+SLOT_BASE+APPDATA.fpu_handler]
|
||||
test eax, eax
|
||||
jz .default
|
||||
|
||||
mov ecx, [reg_eip]
|
||||
mov edx, [reg_esp]
|
||||
sub edx, 4
|
||||
mov [ss:edx+new_app_base], ecx
|
||||
mov [reg_esp], edx
|
||||
mov dword [reg_eip], eax
|
||||
|
||||
pop edx
|
||||
pop ecx
|
||||
pop ebx
|
||||
pop eax
|
||||
|
||||
leave
|
||||
iretd
|
||||
|
||||
.default:
|
||||
pop edx
|
||||
pop ecx
|
||||
pop ebx
|
||||
pop eax
|
||||
leave
|
||||
|
||||
save_ring3_context ;debugger support
|
||||
|
||||
mov bl, 16
|
||||
jmp exc_c
|
||||
|
||||
align 4
|
||||
except_19: ;sse exceptions handler
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
|
||||
push eax
|
||||
push ebx
|
||||
push ecx
|
||||
push edx
|
||||
|
||||
mov ebx, [ss:CURRENT_TASK]
|
||||
shl ebx, 8
|
||||
|
||||
mov eax, [ss:ebx+SLOT_BASE+APPDATA.sse_handler]
|
||||
test eax, eax
|
||||
jz .default
|
||||
|
||||
mov ecx, [reg_eip]
|
||||
mov edx, [reg_esp]
|
||||
sub edx, 4
|
||||
mov [ss:edx+new_app_base], ecx
|
||||
mov [reg_esp], edx
|
||||
mov dword [reg_eip], eax
|
||||
|
||||
pop edx
|
||||
pop ecx
|
||||
pop ebx
|
||||
pop eax
|
||||
|
||||
leave
|
||||
iretd
|
||||
|
||||
.default:
|
||||
pop edx
|
||||
pop ecx
|
||||
pop ebx
|
||||
pop eax
|
||||
leave
|
||||
|
||||
save_ring3_context ;debugger support
|
||||
|
||||
mov bl, 19
|
||||
jmp exc_c
|
||||
|
||||
restore reg_eip
|
||||
restore reg_cs
|
||||
restore reg_eflags
|
||||
restore reg_esp
|
||||
restore reg_ss
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,57 +0,0 @@
|
||||
checkidle:
|
||||
pushad
|
||||
|
||||
cmp [check_idle_semaphore],0
|
||||
jne no_idle_state
|
||||
|
||||
call change_task
|
||||
mov eax,[idlemem]
|
||||
mov ebx,[timer_ticks] ;[0xfdf0]
|
||||
cmp eax,ebx
|
||||
jnz idle_exit
|
||||
call _rdtsc
|
||||
mov ecx,eax
|
||||
idle_loop:
|
||||
hlt
|
||||
cmp [check_idle_semaphore],0
|
||||
jne idle_loop_exit
|
||||
mov eax,[timer_ticks] ;[0xfdf0]
|
||||
cmp ebx,eax
|
||||
jz idle_loop
|
||||
idle_loop_exit:
|
||||
mov [idlemem],eax
|
||||
call _rdtsc
|
||||
sub eax,ecx
|
||||
mov ebx,[idleuse]
|
||||
add ebx,eax
|
||||
mov [idleuse],ebx
|
||||
|
||||
popad
|
||||
ret
|
||||
|
||||
idle_exit:
|
||||
|
||||
mov ebx,[timer_ticks] ;[0xfdf0]
|
||||
mov [idlemem],ebx
|
||||
call change_task
|
||||
|
||||
popad
|
||||
ret
|
||||
|
||||
no_idle_state:
|
||||
|
||||
dec [check_idle_semaphore]
|
||||
|
||||
mov ebx,[timer_ticks] ;[0xfdf0]
|
||||
mov [idlemem],ebx
|
||||
call change_task
|
||||
|
||||
popad
|
||||
ret
|
||||
|
||||
uglobal
|
||||
idlemem dd 0x0
|
||||
idleuse dd 0x0
|
||||
idleusesec dd 0x0
|
||||
check_idle_semaphore dd 0x0
|
||||
endg
|
@ -1,22 +0,0 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; ;
|
||||
; MAIN OS LOOP START ;
|
||||
; ;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
align 32
|
||||
osloop:
|
||||
call [draw_pointer]
|
||||
call checkbuttons
|
||||
call checkwindows
|
||||
; call check_window_move_request
|
||||
call checkmisc
|
||||
call checkVga_N13
|
||||
call stack_handler
|
||||
call checkidle
|
||||
call check_fdd_motor_status
|
||||
jmp osloop
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; ;
|
||||
; MAIN OS LOOP END ;
|
||||
; ;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,217 +0,0 @@
|
||||
$Revision: 434 $
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; IRQ0 HANDLER (TIMER INTERRUPT) ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
align 32
|
||||
irq0:
|
||||
save_ring3_context
|
||||
mov ax, os_data
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
|
||||
inc dword [timer_ticks]
|
||||
|
||||
mov eax, [timer_ticks]
|
||||
call playNote ; <<<--- Speaker driver
|
||||
|
||||
cmp eax,[next_usage_update]
|
||||
jb .nocounter
|
||||
add eax,100
|
||||
mov [next_usage_update],eax
|
||||
call updatecputimes
|
||||
.nocounter:
|
||||
|
||||
cmp [DONT_SWITCH], byte 1
|
||||
jne .change_task
|
||||
|
||||
mov al,0x20 ; send End Of Interrupt signal
|
||||
mov dx,0x20
|
||||
out dx,al
|
||||
|
||||
mov [DONT_SWITCH], byte 0
|
||||
|
||||
restore_ring3_context
|
||||
iret
|
||||
|
||||
.change_task:
|
||||
call update_counters
|
||||
|
||||
call find_next_task
|
||||
mov ecx, eax
|
||||
|
||||
mov al,0x20 ; send End Of Interrupt signal
|
||||
mov dx,0x20
|
||||
out dx,al
|
||||
|
||||
test ecx, ecx ; if there is only one running process
|
||||
jnz .return
|
||||
|
||||
call do_change_task
|
||||
|
||||
.return:
|
||||
restore_ring3_context
|
||||
iret
|
||||
|
||||
|
||||
align 4
|
||||
change_task:
|
||||
|
||||
pushfd
|
||||
cli
|
||||
pushad
|
||||
|
||||
call update_counters
|
||||
; \begin{Mario79}
|
||||
cmp [dma_task_switched], 1
|
||||
jne .find_next_task
|
||||
mov [dma_task_switched], 0
|
||||
mov ebx, [dma_process]
|
||||
cmp [CURRENT_TASK], ebx
|
||||
je .return
|
||||
mov edi, [dma_slot_ptr]
|
||||
mov [CURRENT_TASK], ebx
|
||||
mov [TASK_BASE], edi
|
||||
jmp @f
|
||||
.find_next_task:
|
||||
; \end{Mario79}
|
||||
call find_next_task
|
||||
test eax, eax ; the same task -> skip switch
|
||||
jnz .return
|
||||
@@:
|
||||
mov [DONT_SWITCH],byte 1
|
||||
call do_change_task
|
||||
|
||||
.return:
|
||||
popad
|
||||
popfd
|
||||
|
||||
ret
|
||||
|
||||
|
||||
uglobal
|
||||
align 4
|
||||
far_jump:
|
||||
.offs dd ?
|
||||
.sel dw ?
|
||||
context_counter dd ? ;noname & halyavin
|
||||
next_usage_update dd ?
|
||||
timer_ticks dd ?
|
||||
prev_slot dd ?
|
||||
event_sched dd ?
|
||||
endg
|
||||
|
||||
|
||||
update_counters:
|
||||
mov edi, [TASK_BASE]
|
||||
mov ebx, [edi+TASKDATA.counter_add] ; time stamp counter add
|
||||
call _rdtsc
|
||||
sub eax, ebx
|
||||
add eax, [edi+TASKDATA.counter_sum] ; counter sum
|
||||
mov [edi+TASKDATA.counter_sum], eax
|
||||
ret
|
||||
|
||||
|
||||
; Find next task to execute
|
||||
; result: ebx = number of the selected task
|
||||
; eax = 1 if the task is the same
|
||||
; edi = address of the data for the task in ebx
|
||||
; [0x3000] = ebx and [0x3010] = edi
|
||||
; corrupts other regs
|
||||
find_next_task:
|
||||
mov ebx, [CURRENT_TASK]
|
||||
mov edi, [TASK_BASE]
|
||||
mov [prev_slot], ebx
|
||||
|
||||
.waiting_for_termination:
|
||||
.waiting_for_reuse:
|
||||
.waiting_for_event:
|
||||
.suspended:
|
||||
cmp ebx, [TASK_COUNT]
|
||||
jb @f
|
||||
mov edi, CURRENT_TASK
|
||||
xor ebx, ebx
|
||||
@@:
|
||||
|
||||
add edi,0x20
|
||||
inc ebx
|
||||
|
||||
mov al, byte [edi+TASKDATA.state]
|
||||
test al, al
|
||||
jz .found
|
||||
cmp al, 1
|
||||
jz .suspended
|
||||
cmp al, 2
|
||||
jz .suspended
|
||||
cmp al, 3
|
||||
je .waiting_for_termination
|
||||
cmp al, 4
|
||||
je .waiting_for_termination
|
||||
cmp al, 9
|
||||
je .waiting_for_reuse
|
||||
|
||||
mov [CURRENT_TASK],ebx
|
||||
mov [TASK_BASE],edi
|
||||
push ebx
|
||||
shl ebx, 8
|
||||
mov ebx, [SLOT_BASE + ebx + APPDATA.pl0_stack]
|
||||
add ebx, RING0_STACK_SIZE
|
||||
mov [CURRENT_RING0_ESP], ebx
|
||||
pop ebx
|
||||
|
||||
cmp al, 5
|
||||
jne .noevents
|
||||
call get_event_for_app
|
||||
test eax, eax
|
||||
jz .waiting_for_event
|
||||
mov [event_sched], eax
|
||||
mov [edi+TASKDATA.state], byte 0
|
||||
.noevents:
|
||||
.found:
|
||||
mov [CURRENT_TASK],ebx
|
||||
mov [TASK_BASE],edi
|
||||
call _rdtsc
|
||||
mov [edi+TASKDATA.counter_add],eax
|
||||
|
||||
xor eax, eax
|
||||
cmp ebx, [prev_slot]
|
||||
sete al
|
||||
ret
|
||||
|
||||
; in: ebx = TSS selector index
|
||||
do_change_task:
|
||||
shl ebx, 3
|
||||
xor eax, eax
|
||||
add ebx, tss0
|
||||
mov [far_jump.sel], bx ; selector
|
||||
mov [far_jump.offs], eax ; offset
|
||||
jmp pword [far_jump]
|
||||
inc [context_counter] ;noname & halyavin
|
||||
ret
|
||||
|
||||
|
||||
|
||||
align 4
|
||||
updatecputimes:
|
||||
|
||||
mov eax,[idleuse]
|
||||
mov [idleusesec],eax
|
||||
mov [idleuse],dword 0
|
||||
mov ecx, [TASK_COUNT]
|
||||
mov edi, TASK_DATA
|
||||
.newupdate:
|
||||
mov ebx,[edi+TASKDATA.counter_sum]
|
||||
mov [edi+TASKDATA.cpu_usage],ebx
|
||||
mov [edi+TASKDATA.counter_sum],dword 0
|
||||
add edi,0x20
|
||||
dec ecx
|
||||
jnz .newupdate
|
||||
|
||||
ret
|
@ -1,117 +0,0 @@
|
||||
$Revision: 431 $
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;; Synhronization for MenuetOS. ;;
|
||||
;; Author: Halyavin Andrey, halyavin@land.ru ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
if ~defined sync_inc
|
||||
sync_inc_fix:
|
||||
sync_inc fix sync_inc_fix
|
||||
|
||||
;simplest mutex.
|
||||
macro SimpleMutex name
|
||||
{
|
||||
; iglobal
|
||||
name dd 0
|
||||
name#.type = 1
|
||||
; endg
|
||||
}
|
||||
macro WaitSimpleMutex name
|
||||
{
|
||||
local start_wait,ok
|
||||
start_wait=$
|
||||
cli
|
||||
cmp [name],dword 0
|
||||
jz ok
|
||||
sti
|
||||
call change_task
|
||||
jmp start_wait
|
||||
ok=$
|
||||
push eax
|
||||
mov eax,dword [TASK_BASE+second_base_address]
|
||||
mov eax,[eax+TASKDATA.pid]
|
||||
mov [name],eax
|
||||
pop eax
|
||||
sti
|
||||
}
|
||||
macro ReleaseSimpleMutex name
|
||||
{
|
||||
mov [name],dword 0
|
||||
}
|
||||
macro TryWaitSimpleMutex name ;result in eax and in flags
|
||||
{
|
||||
local ok,try_end
|
||||
cmp [name],dword 0
|
||||
jz ok
|
||||
xor eax,eax
|
||||
jmp try_end
|
||||
ok=$
|
||||
xor eax,eax
|
||||
inc eax
|
||||
try_end=$
|
||||
}
|
||||
macro SimpleCriticalSection name
|
||||
{
|
||||
; iglobal
|
||||
name dd 0
|
||||
dd 0
|
||||
name#.type=2
|
||||
; endg
|
||||
}
|
||||
macro WaitSimpleCriticalSection name
|
||||
{
|
||||
local start_wait,first_wait,inc_counter,end_wait
|
||||
push eax
|
||||
mov eax,[TASK_BASE+second_base_address]
|
||||
mov eax,[eax+TASKDATA.pid]
|
||||
start_wait=$
|
||||
cli
|
||||
cmp [name],dword 0
|
||||
jz first_wait
|
||||
cmp [name],eax
|
||||
jz inc_counter
|
||||
sti
|
||||
call change_task
|
||||
jmp start_wait
|
||||
first_wait=$
|
||||
mov [name],eax
|
||||
mov [name+4],dword 1
|
||||
jmp end_wait
|
||||
inc_counter=$
|
||||
inc dword [name+4]
|
||||
end_wait=$
|
||||
sti
|
||||
pop eax
|
||||
}
|
||||
macro ReleaseSimpleCriticalSection name
|
||||
{
|
||||
local release_end
|
||||
dec dword [name+4]
|
||||
jnz release_end
|
||||
mov [name],dword 0
|
||||
release_end=$
|
||||
}
|
||||
macro TryWaitSimpleCriticalSection name ;result in eax and in flags
|
||||
{
|
||||
local ok,try_end
|
||||
mov eax,[CURRENT_TASK+second_base_address]
|
||||
mov eax,[eax+TASKDATA.pid]
|
||||
cmp [name],eax
|
||||
jz ok
|
||||
cmp [name],0
|
||||
jz ok
|
||||
xor eax,eax
|
||||
jmp try_end
|
||||
ok=$
|
||||
xor eax,eax
|
||||
inc eax
|
||||
try_end=$
|
||||
}
|
||||
_cli equ call MEM_HeapLock
|
||||
_sti equ call MEM_HeapUnLock
|
||||
end if
|
||||
|
@ -1,849 +0,0 @@
|
||||
$Revision: 434 $
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;; ;;
|
||||
;; MenuetOS process management, protected ring3 ;;
|
||||
;; ;;
|
||||
;; Distributed under GPL. See file COPYING for details. ;;
|
||||
;; Copyright 2003 Ville Turjanmaa ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
align 4
|
||||
idtreg:
|
||||
dw 8*0x41-1
|
||||
dd idts+8
|
||||
|
||||
build_process_gdt_tss_pointer:
|
||||
|
||||
mov ecx,tss_data
|
||||
mov edi,0
|
||||
setgdtl2:
|
||||
mov [edi+gdts+ tss0 +0], word tss_step
|
||||
mov [edi+gdts+ tss0 +2], cx
|
||||
mov eax,ecx
|
||||
shr eax,16
|
||||
mov [edi+gdts+ tss0 +4], al
|
||||
mov [edi+gdts+ tss0 +7], ah
|
||||
mov [edi+gdts+ tss0 +5], word 01010000b *256 +11101001b
|
||||
add ecx,tss_step
|
||||
add edi,8
|
||||
cmp edi,8*(max_processes+5)
|
||||
jbe setgdtl2
|
||||
|
||||
ret
|
||||
|
||||
build_interrupt_table:
|
||||
|
||||
mov edi, idts+8
|
||||
mov esi, sys_int
|
||||
mov ecx, 0x40
|
||||
@@:
|
||||
lodsd
|
||||
mov [edi], ax ; lower part of offset
|
||||
mov [edi+2], word os_code ; segment selector
|
||||
mov ax, word 10001110b shl 8 ; type: interrupt gate
|
||||
mov [edi+4], eax
|
||||
add edi, 8
|
||||
loop @b
|
||||
|
||||
;mov edi,8*0x40+idts+8
|
||||
mov dword [edi], (i40 and 0xFFFF) or (os_code shl 16)
|
||||
mov dword [edi+4], (11101111b shl 8) or (i40 and 0xFFFF0000)
|
||||
; type: trap gate
|
||||
ret
|
||||
|
||||
iglobal
|
||||
sys_int:
|
||||
dd e0,debug_exc,e2,e3
|
||||
dd e4,e5,e6,e7
|
||||
dd e8,e9,e10,e11
|
||||
dd e12,e13,page_fault_handler,e15
|
||||
|
||||
dd except_16, e17,e18, except_19
|
||||
times 12 dd unknown_interrupt
|
||||
|
||||
dd irq0 , irq_serv.irq_1, p_irq2 , p_irq3 ;irq_serv.irq_3
|
||||
dd p_irq4 ,irq_serv.irq_5,p_irq6,irq_serv.irq_7
|
||||
dd irq_serv.irq_8, irq_serv.irq_9, irq_serv.irq_10
|
||||
dd irq_serv.irq_11,p_irq12,irqD ,p_irq14,p_irq15
|
||||
|
||||
times 16 dd unknown_interrupt
|
||||
|
||||
dd i40
|
||||
endg
|
||||
|
||||
macro save_ring3_context
|
||||
{
|
||||
push ds es
|
||||
pushad
|
||||
}
|
||||
macro restore_ring3_context
|
||||
{
|
||||
popad
|
||||
pop es ds
|
||||
}
|
||||
|
||||
; simply return control to interrupted process
|
||||
unknown_interrupt:
|
||||
iret
|
||||
|
||||
macro exc_wo_code [num]
|
||||
{
|
||||
forward
|
||||
e#num :
|
||||
save_ring3_context
|
||||
mov bl, num
|
||||
jmp exc_c
|
||||
}
|
||||
|
||||
macro exc_w_code [num]
|
||||
{
|
||||
forward
|
||||
e#num :
|
||||
add esp, 4
|
||||
save_ring3_context
|
||||
mov bl, num
|
||||
jmp exc_c
|
||||
}
|
||||
|
||||
exc_wo_code 0, 1, 2, 3, 4, 5, 6, 9, 15, 18
|
||||
exc_w_code 8, 10, 11, 12, 13, 14, 17
|
||||
|
||||
exc_c:
|
||||
mov ax, os_data
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
|
||||
; test if debugging
|
||||
cli
|
||||
mov eax, [CURRENT_TASK]
|
||||
shl eax, 8
|
||||
mov eax, [SLOT_BASE+eax+APPDATA.debugger_slot]
|
||||
test eax, eax
|
||||
jnz .debug
|
||||
sti
|
||||
; not debuggee => say error and terminate
|
||||
add esp, 28h
|
||||
movzx eax, bl
|
||||
mov [error_interrupt], eax
|
||||
call show_error_parameters
|
||||
|
||||
mov edx, [TASK_BASE]
|
||||
mov [edx + TASKDATA.state], byte 4
|
||||
|
||||
jmp change_task
|
||||
|
||||
.debug:
|
||||
; we are debugged process, notify debugger and suspend ourself
|
||||
; eax=debugger PID
|
||||
cld
|
||||
movzx ecx, bl
|
||||
push ecx
|
||||
mov ecx, [TASK_BASE]
|
||||
push dword [ecx+TASKDATA.pid] ; PID of current process
|
||||
push 12
|
||||
pop ecx
|
||||
push 1 ; 1=exception
|
||||
call debugger_notify
|
||||
pop ecx
|
||||
pop ecx
|
||||
pop ecx
|
||||
mov edx, [TASK_BASE]
|
||||
mov byte [edx+TASKDATA.state], 1 ; suspended
|
||||
call change_task
|
||||
restore_ring3_context
|
||||
iretd
|
||||
|
||||
writehex:
|
||||
pusha
|
||||
|
||||
mov edi, [write_error_to]
|
||||
mov esi, 8
|
||||
@@:
|
||||
mov ecx, eax
|
||||
and ecx, 0xf
|
||||
|
||||
mov cl,[ecx+hexletters]
|
||||
mov [edi],cl
|
||||
dec edi
|
||||
|
||||
shr eax,4
|
||||
dec esi
|
||||
jnz @b
|
||||
|
||||
popa
|
||||
ret
|
||||
|
||||
iglobal
|
||||
hexletters db '0123456789ABCDEF'
|
||||
|
||||
error_interrupt dd -1
|
||||
|
||||
process_error db 'K : Process - forced terminate INT: 00000000',13,10,0
|
||||
process_pid db 'K : Process - forced terminate PID: 00000000',13,10,0
|
||||
process_eip db 'K : Process - forced terminate EIP: 00000000',13,10,0
|
||||
system_error db 'K : Kernel error',13,10,0
|
||||
endg
|
||||
|
||||
uglobal
|
||||
write_error_to dd 0x0
|
||||
endg
|
||||
|
||||
show_error_parameters:
|
||||
|
||||
mov [write_error_to],process_pid+43
|
||||
mov eax,[CURRENT_TASK]
|
||||
shl eax, 5
|
||||
mov eax,[CURRENT_TASK+TASKDATA.pid+eax]
|
||||
call writehex
|
||||
|
||||
mov [write_error_to],process_error+43
|
||||
mov eax,[error_interrupt]
|
||||
call writehex
|
||||
|
||||
cmp dword [esp+4+4], os_code ; CS
|
||||
jnz @f
|
||||
mov esi,system_error
|
||||
call sys_msg_board_str
|
||||
@@:
|
||||
mov eax, [esp+4] ; EIP
|
||||
|
||||
mov [write_error_to],process_eip+43
|
||||
call writehex
|
||||
|
||||
mov esi,process_error
|
||||
call sys_msg_board_str
|
||||
|
||||
mov esi,process_pid
|
||||
call sys_msg_board_str
|
||||
|
||||
mov esi,process_eip
|
||||
call sys_msg_board_str
|
||||
|
||||
ret
|
||||
|
||||
|
||||
|
||||
; irq1 -> hid/keyboard.inc
|
||||
|
||||
|
||||
macro irqh [num]
|
||||
{
|
||||
forward
|
||||
p_irq#num :
|
||||
save_ring3_context
|
||||
mov edi, num
|
||||
jmp irq_c
|
||||
}
|
||||
|
||||
irqh 2,5,7,8,9,10,11
|
||||
|
||||
irq_c:
|
||||
mov ax, os_data
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
call irqhandler
|
||||
restore_ring3_context
|
||||
iret
|
||||
|
||||
p_irq6:
|
||||
save_ring3_context
|
||||
mov ax, os_data
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
call fdc_irq
|
||||
call ready_for_next_irq
|
||||
restore_ring3_context
|
||||
iret
|
||||
|
||||
p_irq3:
|
||||
save_ring3_context
|
||||
mov ax, os_data
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
cmp [com2_mouse_detected],0
|
||||
je old_irq3_handler
|
||||
call check_mouse_data_com2
|
||||
jmp p_irq3_1
|
||||
old_irq3_handler:
|
||||
mov edi,3
|
||||
call irqhandler
|
||||
p_irq3_1:
|
||||
restore_ring3_context
|
||||
iret
|
||||
|
||||
p_irq4:
|
||||
save_ring3_context
|
||||
mov ax, os_data
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
cmp [com1_mouse_detected],0
|
||||
je old_irq4_handler
|
||||
call check_mouse_data_com1
|
||||
jmp p_irq4_1
|
||||
old_irq4_handler:
|
||||
mov edi,4
|
||||
call irqhandler
|
||||
p_irq4_1:
|
||||
restore_ring3_context
|
||||
iret
|
||||
|
||||
p_irq12:
|
||||
save_ring3_context
|
||||
mov ax, os_data
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
call check_mouse_data_ps2
|
||||
restore_ring3_context
|
||||
iret
|
||||
|
||||
p_irq14:
|
||||
save_ring3_context
|
||||
mov ax, os_data
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
call [irq14_func]
|
||||
call ready_for_next_irq_1
|
||||
restore_ring3_context
|
||||
iret
|
||||
p_irq15:
|
||||
save_ring3_context
|
||||
mov ax, os_data
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
call [irq15_func]
|
||||
call ready_for_next_irq_1
|
||||
restore_ring3_context
|
||||
iret
|
||||
|
||||
ready_for_next_irq:
|
||||
mov [check_idle_semaphore],5
|
||||
mov al, 0x20
|
||||
out 0x20, al
|
||||
ret
|
||||
|
||||
ready_for_next_irq_1:
|
||||
mov [check_idle_semaphore],5
|
||||
mov al, 0x20
|
||||
out 0xa0,al
|
||||
out 0x20, al
|
||||
ret
|
||||
|
||||
irqD:
|
||||
save_ring3_context
|
||||
mov ax, os_data
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
|
||||
mov dx,0xf0
|
||||
mov al,0
|
||||
out dx,al
|
||||
|
||||
mov dx,0xa0
|
||||
mov al,0x20
|
||||
out dx,al
|
||||
mov dx,0x20
|
||||
out dx,al
|
||||
|
||||
restore_ring3_context
|
||||
|
||||
iret
|
||||
|
||||
|
||||
irqhandler:
|
||||
|
||||
push edi
|
||||
|
||||
mov esi,edi ; 1
|
||||
shl esi,6 ; 1
|
||||
add esi,irq00read ; 1
|
||||
shl edi,12 ; 1
|
||||
add edi,IRQ_SAVE
|
||||
mov ecx,16
|
||||
|
||||
mov [check_idle_semaphore],5
|
||||
|
||||
irqnewread:
|
||||
dec ecx
|
||||
js irqover
|
||||
|
||||
mov dx,[esi] ; 2+
|
||||
|
||||
cmp dx,0 ; 1
|
||||
jz irqover
|
||||
cmp [esi+3],byte 1 ; 2 ; byte read
|
||||
jne noirqbyte ; 4-11
|
||||
|
||||
in al,dx
|
||||
|
||||
mov edx,[edi]
|
||||
cmp edx,4000
|
||||
je irqfull
|
||||
mov ebx,edi
|
||||
add ebx,0x10
|
||||
add ebx,edx
|
||||
mov [ebx],al
|
||||
inc edx
|
||||
mov [edi],edx
|
||||
|
||||
add esi,4
|
||||
jmp irqnewread
|
||||
|
||||
noirqbyte:
|
||||
|
||||
|
||||
cmp [esi+3],byte 2 ; word read
|
||||
jne noirqword
|
||||
|
||||
in ax,dx
|
||||
|
||||
mov edx,[edi]
|
||||
cmp edx,4000
|
||||
je irqfull
|
||||
mov ebx,edi
|
||||
add ebx,0x10
|
||||
add ebx,edx
|
||||
mov [ebx],ax
|
||||
add edx,2
|
||||
mov [edi],edx
|
||||
add esi,4
|
||||
jmp irqnewread
|
||||
|
||||
noirqword:
|
||||
irqfull:
|
||||
irqover:
|
||||
|
||||
mov al,0x20 ; ready for next irq
|
||||
out 0x20,al
|
||||
|
||||
pop ebx
|
||||
cmp ebx,7
|
||||
jbe noa0
|
||||
out 0xa0,al
|
||||
noa0:
|
||||
|
||||
ret
|
||||
|
||||
|
||||
|
||||
set_application_table_status:
|
||||
push eax
|
||||
|
||||
mov eax,[CURRENT_TASK]
|
||||
shl eax, 5
|
||||
add eax,CURRENT_TASK+TASKDATA.pid
|
||||
mov eax,[eax]
|
||||
|
||||
mov [application_table_status],eax
|
||||
|
||||
pop eax
|
||||
|
||||
ret
|
||||
|
||||
|
||||
clear_application_table_status:
|
||||
push eax
|
||||
|
||||
mov eax,[CURRENT_TASK]
|
||||
shl eax, 5
|
||||
add eax,CURRENT_TASK+TASKDATA.pid
|
||||
mov eax,[eax]
|
||||
|
||||
cmp eax,[application_table_status]
|
||||
jne apptsl1
|
||||
mov [application_table_status],0
|
||||
apptsl1:
|
||||
|
||||
pop eax
|
||||
|
||||
ret
|
||||
|
||||
sys_resize_app_memory:
|
||||
; eax = 1 - resize
|
||||
; ebx = new amount of memory
|
||||
|
||||
cmp eax,1
|
||||
jne .no_application_mem_resize
|
||||
|
||||
stdcall new_mem_resize, ebx
|
||||
mov [esp+36], eax
|
||||
ret
|
||||
|
||||
.no_application_mem_resize:
|
||||
ret
|
||||
|
||||
sys_threads:
|
||||
|
||||
; eax=1 create thread
|
||||
;
|
||||
; ebx=thread start
|
||||
; ecx=thread stack value
|
||||
;
|
||||
; on return : eax = pid
|
||||
jmp new_sys_threads
|
||||
|
||||
iglobal
|
||||
process_terminating db 'K : Process - terminating',13,10,0
|
||||
process_terminated db 'K : Process - done',13,10,0
|
||||
msg_obj_destroy db 'K : destroy app object',13,10,0
|
||||
endg
|
||||
|
||||
; param
|
||||
; esi= slot
|
||||
|
||||
terminate: ; terminate application
|
||||
|
||||
.slot equ esp ;locals
|
||||
|
||||
push esi ;save .slot
|
||||
|
||||
shl esi, 8
|
||||
cmp [SLOT_BASE+esi+APPDATA.dir_table], 0
|
||||
jne @F
|
||||
add esp, 4
|
||||
ret
|
||||
@@:
|
||||
mov esi,process_terminating
|
||||
call sys_msg_board_str
|
||||
@@:
|
||||
cli
|
||||
cmp [application_table_status],0
|
||||
je term9
|
||||
sti
|
||||
call change_task
|
||||
jmp @b
|
||||
term9:
|
||||
call set_application_table_status
|
||||
|
||||
mov esi, [.slot]
|
||||
shl esi,8
|
||||
add esi, SLOT_BASE+APP_OBJ_OFFSET
|
||||
@@:
|
||||
mov eax, [esi+APPOBJ.fd]
|
||||
test eax, eax
|
||||
jz @F
|
||||
|
||||
cmp eax, esi
|
||||
je @F
|
||||
|
||||
push esi
|
||||
call [eax+APPOBJ.destroy]
|
||||
mov esi, msg_obj_destroy
|
||||
call sys_msg_board_str
|
||||
pop esi
|
||||
jmp @B
|
||||
@@:
|
||||
mov eax, [.slot]
|
||||
shl eax, 8
|
||||
mov eax,[SLOT_BASE+eax+APPDATA.dir_table]
|
||||
stdcall destroy_app_space, eax
|
||||
|
||||
mov esi, [.slot]
|
||||
cmp [fpu_owner],esi ; if user fpu last -> fpu user = 1
|
||||
jne @F
|
||||
|
||||
mov [fpu_owner],1
|
||||
mov eax, [256+SLOT_BASE+APPDATA.fpu_state]
|
||||
clts
|
||||
bt [cpu_caps], CAPS_SSE
|
||||
jnc .no_SSE
|
||||
fxrstor [eax]
|
||||
jmp @F
|
||||
.no_SSE:
|
||||
fnclex
|
||||
frstor [eax]
|
||||
@@:
|
||||
|
||||
mov [KEY_COUNT],byte 0 ; empty keyboard buffer
|
||||
mov [BTN_COUNT],byte 0 ; empty button buffer
|
||||
|
||||
|
||||
; remove defined hotkeys
|
||||
mov eax, hotkey_list
|
||||
.loop:
|
||||
cmp [eax+8], esi
|
||||
jnz .cont
|
||||
mov ecx, [eax]
|
||||
jecxz @f
|
||||
push dword [eax+12]
|
||||
pop dword [ecx+12]
|
||||
@@:
|
||||
mov ecx, [eax+12]
|
||||
push dword [eax]
|
||||
pop dword [ecx]
|
||||
xor ecx, ecx
|
||||
mov [eax], ecx
|
||||
mov [eax+4], ecx
|
||||
mov [eax+8], ecx
|
||||
mov [eax+12], ecx
|
||||
.cont:
|
||||
add eax, 16
|
||||
cmp eax, hotkey_list+256*16
|
||||
jb .loop
|
||||
; remove hotkeys in buffer
|
||||
mov eax, hotkey_buffer
|
||||
.loop2:
|
||||
cmp [eax], esi
|
||||
jnz .cont2
|
||||
and dword [eax+4], 0
|
||||
and dword [eax], 0
|
||||
.cont2:
|
||||
add eax, 8
|
||||
cmp eax, hotkey_buffer+120*8
|
||||
jb .loop2
|
||||
|
||||
mov ecx,esi ; remove buttons
|
||||
bnewba2:
|
||||
mov edi,[BTN_ADDR]
|
||||
mov eax,edi
|
||||
cld
|
||||
movzx ebx,word [edi]
|
||||
inc bx
|
||||
bnewba:
|
||||
dec bx
|
||||
jz bnmba
|
||||
add eax,0x10
|
||||
cmp cx,[eax]
|
||||
jnz bnewba
|
||||
pusha
|
||||
mov ecx,ebx
|
||||
inc ecx
|
||||
shl ecx,4
|
||||
mov ebx,eax
|
||||
add eax,0x10
|
||||
call memmove
|
||||
dec dword [edi]
|
||||
popa
|
||||
jmp bnewba2
|
||||
bnmba:
|
||||
|
||||
pusha ; save window coordinates for window restoring
|
||||
cld
|
||||
shl esi,5
|
||||
add esi,window_data
|
||||
mov eax,[esi+WDATA.box.left]
|
||||
mov [dlx],eax
|
||||
add eax,[esi+WDATA.box.width]
|
||||
mov [dlxe],eax
|
||||
mov eax,[esi+WDATA.box.top]
|
||||
mov [dly],eax
|
||||
add eax,[esi+WDATA.box.height]
|
||||
mov [dlye],eax
|
||||
|
||||
xor eax, eax
|
||||
mov [esi+WDATA.box.left],eax
|
||||
mov [esi+WDATA.box.width],eax
|
||||
mov [esi+WDATA.box.top],eax
|
||||
mov [esi+WDATA.box.height],eax
|
||||
mov [esi+WDATA.cl_workarea],eax
|
||||
mov [esi+WDATA.cl_titlebar],eax
|
||||
mov [esi+WDATA.cl_frames],eax
|
||||
mov dword [esi+WDATA.reserved],eax ; clear all flags: wstate, redraw, wdrawn
|
||||
lea edi, [esi-window_data+draw_data]
|
||||
mov ecx,32/4
|
||||
rep stosd
|
||||
popa
|
||||
|
||||
; debuggee test
|
||||
pushad
|
||||
mov edi, esi
|
||||
shl edi, 5
|
||||
mov eax, [SLOT_BASE+edi*8+APPDATA.debugger_slot]
|
||||
test eax, eax
|
||||
jz .nodebug
|
||||
push 8
|
||||
pop ecx
|
||||
push dword [CURRENT_TASK+edi+TASKDATA.pid] ; PID
|
||||
push 2
|
||||
call debugger_notify
|
||||
pop ecx
|
||||
pop ecx
|
||||
.nodebug:
|
||||
popad
|
||||
|
||||
mov ebx, [.slot]
|
||||
shl ebx, 8
|
||||
mov ebx,[SLOT_BASE+ebx+APPDATA.pl0_stack]
|
||||
|
||||
stdcall kernel_free, ebx
|
||||
|
||||
mov edi, [.slot]
|
||||
shl edi,8
|
||||
add edi,SLOT_BASE
|
||||
mov eax, 0x20202020
|
||||
stosd
|
||||
stosd
|
||||
stosd
|
||||
mov ecx,244/4
|
||||
xor eax, eax
|
||||
rep stosd
|
||||
|
||||
; activate window
|
||||
movzx eax, word [WIN_STACK + esi*2]
|
||||
cmp eax, [TASK_COUNT]
|
||||
jne .dont_activate
|
||||
pushad
|
||||
.check_next_window:
|
||||
dec eax
|
||||
cmp eax, 1
|
||||
jbe .nothing_to_activate
|
||||
lea esi, [WIN_POS+eax*2]
|
||||
movzx edi, word [esi] ; edi = process
|
||||
shl edi, 5
|
||||
cmp [CURRENT_TASK + edi + TASKDATA.state], byte 9 ; skip dead slots
|
||||
je .check_next_window
|
||||
add edi, window_data
|
||||
; \begin{diamond}[19.09.2006]
|
||||
; skip minimized windows
|
||||
test [edi + WDATA.fl_wstate], WSTATE_MINIMIZED
|
||||
jnz .check_next_window
|
||||
; \end{diamond}
|
||||
call waredraw
|
||||
.nothing_to_activate:
|
||||
popad
|
||||
.dont_activate:
|
||||
|
||||
push esi ; remove hd1 & cd & flp reservation
|
||||
shl esi, 5
|
||||
mov esi, [esi+CURRENT_TASK+TASKDATA.pid]
|
||||
cmp [hd1_status], esi
|
||||
jnz @f
|
||||
call free_hd_channel
|
||||
mov [hd1_status], 0
|
||||
@@:
|
||||
cmp [cd_status], esi
|
||||
jnz @f
|
||||
call free_cd_channel
|
||||
mov [cd_status], 0
|
||||
@@:
|
||||
cmp [flp_status], esi
|
||||
jnz @f
|
||||
mov [flp_status], 0
|
||||
@@:
|
||||
pop esi
|
||||
|
||||
pusha ; remove all irq reservations
|
||||
mov eax,esi
|
||||
shl eax, 5
|
||||
mov eax,[eax+CURRENT_TASK+TASKDATA.pid]
|
||||
mov edi,irq_owner
|
||||
mov ecx,16
|
||||
newirqfree:
|
||||
scasd
|
||||
jne nofreeirq
|
||||
mov [edi-4],dword 0
|
||||
nofreeirq:
|
||||
loop newirqfree
|
||||
popa
|
||||
|
||||
pusha ; remove all port reservations
|
||||
mov edx,esi
|
||||
shl edx, 5
|
||||
add edx,CURRENT_TASK
|
||||
mov edx,[edx+TASKDATA.pid]
|
||||
|
||||
rmpr0:
|
||||
|
||||
mov esi,[RESERVED_PORTS]
|
||||
|
||||
cmp esi,0
|
||||
je rmpr9
|
||||
|
||||
rmpr3:
|
||||
|
||||
mov edi,esi
|
||||
shl edi,4
|
||||
add edi,RESERVED_PORTS
|
||||
|
||||
cmp edx,[edi]
|
||||
je rmpr4
|
||||
|
||||
dec esi
|
||||
jnz rmpr3
|
||||
|
||||
jmp rmpr9
|
||||
|
||||
rmpr4:
|
||||
|
||||
mov ecx,256
|
||||
sub ecx,esi
|
||||
shl ecx,4
|
||||
|
||||
mov esi,edi
|
||||
add esi,16
|
||||
cld
|
||||
rep movsb
|
||||
|
||||
dec dword [RESERVED_PORTS]
|
||||
|
||||
jmp rmpr0
|
||||
|
||||
rmpr9:
|
||||
|
||||
popa
|
||||
mov edi,esi ; do not run this process slot
|
||||
shl edi, 5
|
||||
mov [edi+CURRENT_TASK + TASKDATA.state],byte 9
|
||||
; debugger test - terminate all debuggees
|
||||
mov eax, 2
|
||||
mov ecx, SLOT_BASE+2*0x100+APPDATA.debugger_slot
|
||||
.xd0:
|
||||
cmp eax, [TASK_COUNT]
|
||||
ja .xd1
|
||||
cmp dword [ecx], esi
|
||||
jnz @f
|
||||
and dword [ecx], 0
|
||||
pushad
|
||||
xchg eax, ebx
|
||||
mov eax, 2
|
||||
call sys_system
|
||||
popad
|
||||
@@:
|
||||
inc eax
|
||||
add ecx, 0x100
|
||||
jmp .xd0
|
||||
.xd1:
|
||||
; call systest
|
||||
sti ; .. and life goes on
|
||||
|
||||
mov eax, [dlx]
|
||||
mov ebx, [dly]
|
||||
mov ecx, [dlxe]
|
||||
mov edx, [dlye]
|
||||
call calculatescreen
|
||||
xor eax, eax
|
||||
xor esi, esi
|
||||
call redrawscreen
|
||||
|
||||
mov [MOUSE_BACKGROUND],byte 0 ; no mouse background
|
||||
mov [DONT_DRAW_MOUSE],byte 0 ; draw mouse
|
||||
|
||||
mov [application_table_status],0
|
||||
mov esi,process_terminated
|
||||
call sys_msg_board_str
|
||||
add esp, 4
|
||||
ret
|
||||
restore .slot
|
||||
|
||||
iglobal
|
||||
boot_sched_1 db 'Building gdt tss pointer',0
|
||||
boot_sched_2 db 'Building IDT table',0
|
||||
endg
|
||||
|
||||
|
||||
build_scheduler:
|
||||
|
||||
; mov esi,boot_sched_1
|
||||
; call boot_log
|
||||
call build_process_gdt_tss_pointer
|
||||
|
||||
; mov esi,boot_sched_2
|
||||
; call boot_log
|
||||
call build_interrupt_table
|
||||
|
||||
ret
|
||||
|
@ -1,238 +0,0 @@
|
||||
$Revision: 434 $
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; SYSTEM CALL ENTRY ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
align 32
|
||||
i40:
|
||||
; diamond, 27.03.2007: handler does not require disabled interrupts
|
||||
; so interrupts remain enabled when calling int 0x40
|
||||
push ds es
|
||||
pushad
|
||||
cld
|
||||
|
||||
mov ax,word os_data
|
||||
mov ds,ax
|
||||
mov es,ax
|
||||
|
||||
; load all registers in crossed order
|
||||
mov eax, ebx
|
||||
mov ebx, ecx
|
||||
mov ecx, edx
|
||||
mov edx, esi
|
||||
mov esi, edi
|
||||
mov edi, [esp+28]
|
||||
|
||||
; enable interupts - a task switch or an IRQ _CAN_ interrupt i40 handler
|
||||
; sti
|
||||
push eax
|
||||
and edi,0xff
|
||||
call dword [servetable+edi*4]
|
||||
pop eax
|
||||
; cli
|
||||
|
||||
popad
|
||||
pop es ds
|
||||
iretd
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; SYSENTER ENTRY ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;uglobal
|
||||
;times 100 db ?
|
||||
;sysenter_stack:
|
||||
;endg
|
||||
|
||||
align 32
|
||||
SYSENTER_VAR equ 0
|
||||
sysenter_entry:
|
||||
; Íàñòðàèâàåì ñòåê
|
||||
; cli sysenter clear IF
|
||||
; push eax
|
||||
; mov eax, [ss:CURRENT_TASK]
|
||||
; shl eax, 8
|
||||
; mov eax, [ss:SLOT_BASE + eax + APPDATA.pl0_stack]
|
||||
; lea esp, [eax + RING0_STACK_SIZE] ; configure ESP
|
||||
; mov eax, [ss:sysenter_stack - 4] ; eax - original eax, from app
|
||||
mov esp, [ss:CURRENT_RING0_ESP]
|
||||
|
||||
sti
|
||||
;------------------
|
||||
push ds es
|
||||
pushad
|
||||
cld
|
||||
|
||||
mov ax, word os_data
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
|
||||
mov eax, ebx
|
||||
mov ebx, ecx
|
||||
mov ecx, edx
|
||||
mov edx, esi
|
||||
mov esi, edi
|
||||
mov edi, [esp + 28]
|
||||
|
||||
push eax
|
||||
and edi, 0xff
|
||||
call dword [servetable + edi * 4]
|
||||
pop eax
|
||||
|
||||
popad
|
||||
pop es ds
|
||||
;------------------
|
||||
mov edx, [SYSENTER_VAR] ; eip
|
||||
mov ecx, [SYSENTER_VAR + 4] ; esp
|
||||
sysexit
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; SYSCALL ENTRY ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
align 32
|
||||
syscall_entry:
|
||||
|
||||
; cli syscall clear IF
|
||||
xchg esp, [ss:CURRENT_RING0_ESP]
|
||||
push ecx
|
||||
lea ecx, [esp+4]
|
||||
xchg ecx, [ss:CURRENT_RING0_ESP]
|
||||
sti
|
||||
push ecx
|
||||
mov ecx, [ecx]
|
||||
|
||||
; mov [ss:sysenter_stack - 4], eax
|
||||
; mov eax, [ss:CURRENT_TASK]
|
||||
; shl eax, 8
|
||||
; mov eax, [ss:SLOT_BASE + eax + APPDATA.pl0_stack]
|
||||
; lea esp, [eax + RING0_STACK_SIZE] ; configure ESP
|
||||
; mov eax, [ss:sysenter_stack - 4] ; eax - original eax, from app
|
||||
|
||||
;------------------
|
||||
push ds es
|
||||
pushad
|
||||
cld
|
||||
|
||||
mov ax, word os_data
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
|
||||
mov eax, ebx
|
||||
mov ebx, ecx
|
||||
mov ecx, edx
|
||||
mov edx, esi
|
||||
mov esi, edi
|
||||
mov edi, [esp + 28]
|
||||
|
||||
push eax
|
||||
and edi, 0xff
|
||||
call dword [servetable + edi * 4]
|
||||
pop eax
|
||||
|
||||
popad
|
||||
pop es ds
|
||||
;------------------
|
||||
|
||||
mov ecx, [ss:esp+4]
|
||||
pop esp
|
||||
sysret
|
||||
|
||||
iglobal
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; SYSTEM FUNCTIONS TABLE ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
align 4
|
||||
servetable:
|
||||
|
||||
dd sys_drawwindow ; 0-DrawWindow
|
||||
dd syscall_setpixel ; 1-SetPixel
|
||||
dd sys_getkey ; 2-GetKey
|
||||
dd sys_clock ; 3-GetTime
|
||||
dd syscall_writetext ; 4-WriteText
|
||||
dd delay_hs ; 5-DelayHs
|
||||
dd syscall_openramdiskfile ; 6-OpenRamdiskFile
|
||||
dd syscall_putimage ; 7-PutImage
|
||||
dd sys_button ; 8-DefineButton
|
||||
dd sys_cpuusage ; 9-GetProcessInfo
|
||||
dd sys_waitforevent ; 10-WaitForEvent
|
||||
dd sys_getevent ; 11-CheckForEvent
|
||||
dd sys_redrawstat ; 12-BeginDraw and EndDraw
|
||||
dd syscall_drawrect ; 13-DrawRect
|
||||
dd syscall_getscreensize ; 14-GetScreenSize
|
||||
dd sys_background ; 15-bgr
|
||||
dd sys_cachetodiskette ; 16-FlushFloppyCache
|
||||
dd sys_getbutton ; 17-GetButton
|
||||
dd sys_system ; 18-System Services
|
||||
dd paleholder;undefined_syscall ; 19-reserved
|
||||
dd sys_midi ; 20-ResetMidi and OutputMidi
|
||||
dd sys_setup ; 21-SetMidiBase,SetKeymap,SetShiftKeymap,.
|
||||
dd sys_settime ; 22-setting date,time,clock and alarm-clock
|
||||
dd sys_wait_event_timeout ; 23-TimeOutWaitForEvent
|
||||
dd syscall_cdaudio ; 24-PlayCdTrack,StopCd and GetCdPlaylist
|
||||
dd sys_sb16 ; 25-SetSb16
|
||||
dd sys_getsetup ; 26-GetMidiBase,GetKeymap,GetShiftKeymap,.
|
||||
dd undefined_syscall ; 27-reserved
|
||||
dd sys_sb16II ; 28-SetSb16
|
||||
dd sys_date ; 29-GetDate
|
||||
dd undefined_syscall ; 30-reserved
|
||||
dd undefined_syscall ; 31-reserved
|
||||
dd syscall_delramdiskfile ; 32-DelRamdiskFile
|
||||
dd syscall_writeramdiskfile; 33-WriteRamdiskFile
|
||||
dd undefined_syscall ; 34-reserved
|
||||
dd syscall_getpixel ; 35-GetPixel
|
||||
dd syscall_readstring ; 36-ReadString (not yet ready)
|
||||
dd readmousepos ; 37-GetMousePosition_ScreenRelative,.
|
||||
dd syscall_drawline ; 38-DrawLine
|
||||
dd sys_getbackground ; 39-GetBackgroundSize,ReadBgrData,.
|
||||
dd set_app_param ; 40-WantEvents
|
||||
dd syscall_getirqowner ; 41-GetIrqOwner
|
||||
dd get_irq_data ; 42-ReadIrqData
|
||||
dd sys_outport ; 43-SendDeviceData
|
||||
dd sys_programirq ; 44-ProgramIrqs
|
||||
dd reserve_free_irq ; 45-ReserveIrq and FreeIrq
|
||||
dd syscall_reserveportarea ; 46-ReservePortArea and FreePortArea
|
||||
dd display_number ; 47-WriteNum
|
||||
dd display_settings ; 48-SetRedrawType and SetButtonType
|
||||
dd sys_apm ; 49-Advanced Power Management (APM)
|
||||
dd random_shaped_window ; 50-Window shape & scale
|
||||
dd syscall_threads ; 51-Threads
|
||||
dd stack_driver_stat ; 52-Stack driver status
|
||||
dd socket ; 53-Socket interface
|
||||
dd user_events ; 54-User events
|
||||
dd sound_interface ; 55-Sound interface
|
||||
dd undefined_syscall ; 56-reserved
|
||||
dd undefined_syscall ; 57-reserved
|
||||
dd file_system ; 58-Common file system interface
|
||||
dd undefined_syscall ; 59-reserved
|
||||
dd sys_IPC ; 60-Inter Process Communication
|
||||
dd sys_gs ; 61-Direct graphics access
|
||||
dd sys_pci ; 62-PCI functions
|
||||
dd sys_msg_board ; 63-System message board
|
||||
dd sys_resize_app_memory ; 64-Resize application memory usage
|
||||
dd syscall_putimage_palette; 65-PutImagePalette
|
||||
dd sys_process_def ; 66-Process definitions - keyboard
|
||||
dd sys_window_move ; 67-Window move or resize
|
||||
dd new_services ; 68-Some internal services
|
||||
dd sys_debug_services ; 69-Debug
|
||||
dd file_system_lfn ; 70-Common file system interface, version 2
|
||||
dd syscall_windowsettings ; 71-Window settings
|
||||
|
||||
times 255 - ( ($-servetable) /4 ) dd undefined_syscall
|
||||
|
||||
dd sys_end ; -1-end application
|
||||
endg
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,55 +0,0 @@
|
||||
$Revision: 431 $
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;
|
||||
; Call of videomode driver's functions
|
||||
;
|
||||
; (Add in System function 21 (and/or 26) as a subfunction 13)
|
||||
;
|
||||
; Author: Trans
|
||||
; Date: 19.07.2003
|
||||
;
|
||||
; Include in MeOS kernel and compile with FASM
|
||||
;
|
||||
|
||||
uglobal
|
||||
old_screen_width dd ?
|
||||
old_screen_height dd ?
|
||||
endg
|
||||
|
||||
cmp eax,13 ; CALL VIDEOMODE DRIVER FUNCTIONS
|
||||
jne .no_vmode_drv_access
|
||||
pushd [ScreenWidth] [ScreenHeight]
|
||||
popd [old_screen_height] [old_screen_width]
|
||||
or eax,-1 ; If driver is absent then eax does not change
|
||||
call 0x760100 ; Entry point of video driver
|
||||
mov [esp+36],eax
|
||||
mov [esp+24],ebx
|
||||
mov [esp+32],ecx
|
||||
; mov [esp+28],edx
|
||||
mov eax,[old_screen_width]
|
||||
mov ebx,[old_screen_height]
|
||||
sub eax,[ScreenWidth]
|
||||
jnz @f
|
||||
sub ebx,[ScreenHeight]
|
||||
jz .resolution_wasnt_changed
|
||||
jmp .lp1
|
||||
@@: sub ebx,[ScreenHeight]
|
||||
.lp1: sub [screen_workarea.right],eax
|
||||
sub [screen_workarea.bottom],ebx
|
||||
|
||||
call repos_windows
|
||||
mov eax, 0
|
||||
mov ebx, 0
|
||||
mov ecx, [ScreenWidth]
|
||||
mov edx, [ScreenHeight]
|
||||
call calculatescreen
|
||||
|
||||
.resolution_wasnt_changed:
|
||||
ret
|
||||
.no_vmode_drv_access:
|
@ -1,347 +0,0 @@
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
|
||||
Version 2, June 1991
|
||||
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
675 Mass Ave, Cambridge, MA 02139, USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Appendix: How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
@ -1,518 +0,0 @@
|
||||
--------p-155300-----------------------------
|
||||
INT 15 - Advanced Power Management v1.0+ - INSTALLATION CHECK
|
||||
AX = 5300h
|
||||
BX = device ID of system BIOS (0000h)
|
||||
Return: CF clear if successful
|
||||
AH = major version (BCD)
|
||||
AL = minor version (BCD)
|
||||
BX = 504Dh ("PM")
|
||||
CX = flags (see #00472)
|
||||
CF set on error
|
||||
AH = error code (06h,09h,86h) (see #00473)
|
||||
BUG: early versions of the Award Modular BIOS with built-in APM support
|
||||
reportedly do not set BX on return
|
||||
|
||||
Bitfields for APM flags:
|
||||
Bit(s) Description (Table 00472)
|
||||
0 16-bit protected mode interface supported
|
||||
1 32-bit protected mode interface supported
|
||||
2 CPU idle call reduces processor speed
|
||||
3 BIOS power management disabled
|
||||
4 BIOS power management disengaged (APM v1.1)
|
||||
5-7 reserved
|
||||
|
||||
(Table 00473)
|
||||
Values for APM error code:
|
||||
01h power management functionality disabled
|
||||
02h interface connection already in effect
|
||||
03h interface not connected
|
||||
04h real-mode interface not connected
|
||||
05h 16-bit protected-mode interface already connected
|
||||
06h 16-bit protected-mode interface not supported
|
||||
07h 32-bit protected-mode interface already connected
|
||||
08h 32-bit protected-mode interface not supported
|
||||
09h unrecognized device ID
|
||||
0Ah invalid parameter value in CX
|
||||
0Bh (APM v1.1) interface not engaged
|
||||
0Ch (APM v1.2) function not supported
|
||||
0Dh (APM v1.2) Resume Timer disabled
|
||||
0Eh-1Fh reserved for other interface and general errors
|
||||
20h-3Fh reserved for CPU errors
|
||||
40h-5Fh reserved for device errors
|
||||
60h can't enter requested state
|
||||
61h-7Fh reserved for other system errors
|
||||
80h no power management events pending
|
||||
81h-85h reserved for other power management event errors
|
||||
86h APM not present
|
||||
87h-9Fh reserved for other power management event errors
|
||||
A0h-FEh reserved
|
||||
FFh undefined
|
||||
--------p-155301-----------------------------
|
||||
INT 15 - Advanced Power Management v1.0+ - CONNECT REAL-MODE INTERFACE
|
||||
AX = 5301h
|
||||
BX = device ID of system BIOS (0000h)
|
||||
Return: CF clear if successful
|
||||
CF set on error
|
||||
AH = error code (02h,05h,07h,09h) (see #00473)
|
||||
Note: on connection, an APM v1.1 or v1.2 BIOS switches to APM v1.0
|
||||
compatibility mode until it is informed that the user supports a
|
||||
newer version of APM (see AX=530Eh)
|
||||
SeeAlso: AX=5302h,AX=5303h,AX=5304h
|
||||
--------p-155302-----------------------------
|
||||
INT 15 R - Advanced Power Management v1.0+ - CONNECT 16-BIT PROTMODE INTERFACE
|
||||
AX = 5302h
|
||||
BX = device ID of system BIOS (0000h)
|
||||
Return: CF clear if successful
|
||||
AX = real-mode segment base address of protected-mode 16-bit code
|
||||
segment
|
||||
BX = offset of entry point
|
||||
CX = real-mode segment base address of protected-mode 16-bit data
|
||||
segment
|
||||
---APM v1.1---
|
||||
SI = APM BIOS code segment length
|
||||
DI = APM BIOS data segment length
|
||||
CF set on error
|
||||
AH = error code (02h,05h,06h,07h,09h) (see #00473)
|
||||
Notes: the caller must initialize two consecutive descriptors with the
|
||||
returned segment base addresses; these descriptors must be valid
|
||||
whenever the protected-mode interface is called, and will have
|
||||
their limits arbitrarily set to 64K.
|
||||
the protected mode interface is invoked by making a far call with the
|
||||
same register values as for INT 15; it must be invoked while CPL=0,
|
||||
the code segment descriptor must have a DPL of 0, the stack must be
|
||||
in a 16-bit segment and have enough room for BIOS use and possible
|
||||
interrupts, and the current I/O permission bit map must allow access
|
||||
to the I/O ports used for power management.
|
||||
functions 00h-03h are not available from protected mode
|
||||
on connection, an APM v1.1 or v1.2 BIOS switches to APM v1.0
|
||||
compatibility mode until it is informed that the user supports a
|
||||
newer version of APM (see AX=530Eh)
|
||||
SeeAlso: AX=5301h,AX=5303h,AX=5304h
|
||||
--------p-155303-----------------------------
|
||||
INT 15 - Advanced Power Management v1.0+ - CONNECT 32-BIT PROTMODE INTERFACE
|
||||
AX = 5303h
|
||||
BX = device ID of system BIOS (0000h)
|
||||
Return: CF clear if successful
|
||||
AX = real-mode segment base address of protected-mode 32-bit code
|
||||
segment
|
||||
EBX = offset of entry point
|
||||
CX = real-mode segment base address of protected-mode 16-bit code
|
||||
segment
|
||||
DX = real-mode segment base address of protected-mode 16-bit data
|
||||
segment
|
||||
---APM v1.1---
|
||||
SI = APM BIOS code segment length
|
||||
DI = APM BIOS data segment length
|
||||
CF set on error
|
||||
AH = error code (02h,05h,07h,08h,09h) (see #00473)
|
||||
Notes: the caller must initialize three consecutive descriptors with the
|
||||
returned segment base addresses for 32-bit code, 16-bit code, and
|
||||
16-bit data, respectively; these descriptors must be valid whenever
|
||||
the protected-mode interface is called, and will have their limits
|
||||
arbitrarily set to 64K.
|
||||
the protected mode interface is invoked by making a far call to the
|
||||
32-bit code segment with the same register values as for INT 15; it
|
||||
must be invoked while CPL=0, the code segment descriptor must have a
|
||||
DPL of 0, the stack must be in a 32-bit segment and have enough room
|
||||
for BIOS use and possible interrupts, and the current I/O permission
|
||||
bit map must allow access to the I/O ports used for power management.
|
||||
functions 00h-03h are not available from protected mode
|
||||
on connection, an APM v1.1 or v1.2 BIOS switches to APM v1.0
|
||||
compatibility mode until it is informed that the user supports a
|
||||
newer version of APM (see AX=530Eh)
|
||||
SeeAlso: AX=5301h,AX=5302h,AX=5304h
|
||||
--------p-155304-----------------------------
|
||||
INT 15 - Advanced Power Management v1.0+ - DISCONNECT INTERFACE
|
||||
AX = 5304h
|
||||
BX = device ID of system BIOS (0000h)
|
||||
Return: CF clear if successful
|
||||
CF set on error
|
||||
AH = error code (03h,09h) (see #00473)
|
||||
SeeAlso: AX=5301h,AX=5302h,AX=5303h
|
||||
--------p-155305-----------------------------
|
||||
INT 15 - Advanced Power Management v1.0+ - CPU IDLE
|
||||
AX = 5305h
|
||||
Return: CF clear if successful (after system leaves idle state)
|
||||
CF set on error
|
||||
AH = error code (03h,0Bh) (see #00473)
|
||||
Notes: call when the system is idle and should be suspended until the next
|
||||
system event or interrupt
|
||||
should not be called from within a hardware interrupt handler to avoid
|
||||
reentrance problems
|
||||
if an interrupt causes the system to resume normal processing, the
|
||||
interrupt may or may not have been handled when the BIOS returns
|
||||
from this call; thus, the caller should allow interrupts on return
|
||||
interrupt handlers may not retain control if the BIOS allows
|
||||
interrupts while in idle mode even if they are able to determine
|
||||
that they were called from idle mode
|
||||
the caller should issue this call continuously in a loop until it needs
|
||||
to perform some processing of its own
|
||||
SeeAlso: AX=1000h,AX=5306h,INT 2F/AX=1680h
|
||||
--------p-155306-----------------------------
|
||||
INT 15 - Advanced Power Management v1.0+ - CPU BUSY
|
||||
AX = 5306h
|
||||
Return: CF clear if successful
|
||||
CF set on error
|
||||
AH = error code (03h,0Bh) (see #00473)
|
||||
Notes: called to ensure that the system runs at full speed even on systems
|
||||
where the BIOS is unable to recognize increased activity (especially
|
||||
if interrupts are hooked by other programs and not chained to the
|
||||
BIOS)
|
||||
this call may be made even when the system is already running at full
|
||||
speed, but it will create unnecessary overhead
|
||||
should not be called from within a hardware interrupt handler to avoid
|
||||
reentrance problems
|
||||
SeeAlso: AX=5305h
|
||||
--------p-155307-----------------------------
|
||||
INT 15 - Advanced Power Management v1.0+ - SET POWER STATE
|
||||
AX = 5307h
|
||||
BX = device ID (see #00474)
|
||||
CX = system state ID (see #00475)
|
||||
Return: CF clear if successful
|
||||
CF set on error
|
||||
AH = error code (01h,03h,09h,0Ah,0Bh,60h) (see #00473)
|
||||
Note: should not be called from within a hardware interrupt handler to avoid
|
||||
reentrance problems
|
||||
SeeAlso: AX=530Ch
|
||||
|
||||
(Table 00474)
|
||||
Values for APM device IDs:
|
||||
0000h system BIOS
|
||||
0001h all devices for which the system BIOS manages power
|
||||
01xxh display (01FFh for all attached display devices)
|
||||
02xxh secondary storage (02FFh for all attached secondary storage devices)
|
||||
03xxh parallel ports (03FFh for all attached parallel ports)
|
||||
04xxh serial ports (04FFh for all attached serial ports)
|
||||
---APM v1.1+ ---
|
||||
05xxh network adapters (05FFh for all attached network adapters)
|
||||
06xxh PCMCIA sockets (06FFh for all)
|
||||
0700h-7FFFh reserved
|
||||
80xxh system battery devices (APM v1.2)
|
||||
8100h-DFFFh reserved
|
||||
Exxxh OEM-defined power device IDs
|
||||
F000h-FFFFh reserved
|
||||
|
||||
(Table 00475)
|
||||
Values for system state ID:
|
||||
0000h ready (not supported for device ID 0001h)
|
||||
0001h stand-by
|
||||
0002h suspend
|
||||
0003h off (not supported for device ID 0001h in APM v1.0)
|
||||
---APM v1.1---
|
||||
0004h last request processing notification (only for device ID 0001h)
|
||||
0005h last request rejected (only for device ID 0001h)
|
||||
0006h-001Fh reserved system states
|
||||
0020h-003Fh OEM-defined system states
|
||||
0040h-007Fh OEM-defined device states
|
||||
0080h-FFFFh reserved device states
|
||||
--------p-155307CX0001-----------------------
|
||||
INT 15 - Advanced Power Management v1.0+ - SYSTEM STAND-BY
|
||||
AX = 5307h
|
||||
CX = 0001h
|
||||
BX = 0001h (device ID for all power-managed devices)
|
||||
Return: CF clear
|
||||
Notes: puts the entire system into stand-by mode; normally called in response
|
||||
to a System Stand-by Request notification after any necessary
|
||||
processing, but may also be invoked at the caller's discretion
|
||||
should not be called from within a hardware interrupt handler to avoid
|
||||
reentrance problems
|
||||
the stand-by state is typically exited on an interrupt
|
||||
SeeAlso: AX=4280h,AX=5307h/CX=0002h"SUSPEND",AX=5307h/CX=0003h,AX=530Bh
|
||||
--------p-155307CX0002-----------------------
|
||||
INT 15 - Advanced Power Management v1.0+ - SUSPEND SYSTEM
|
||||
AX = 5307h
|
||||
CX = 0002h
|
||||
BX = 0001h (device ID for all power-managed devices)
|
||||
Return: after system is resumed
|
||||
CF clear
|
||||
Notes: puts the entire system into a low-power suspended state; normally
|
||||
called in response to a Suspend System Request notification after
|
||||
any necessary processing, but may also be invoked at the caller's
|
||||
discretion
|
||||
should not be called from within a hardware interrupt handler to avoid
|
||||
reentrance problems
|
||||
the caller may need to update its date and time values because the
|
||||
system could have been suspended for a long period of time
|
||||
SeeAlso: AX=5307h/CX=0001h"STAND-BY",AX=530Bh
|
||||
--------p-155307CX0003-----------------------
|
||||
INT 15 - Advanced Power Management v1.2 - TURN OFF SYSTEM
|
||||
AX = 5307h
|
||||
CX = 0003h
|
||||
BX = 0001h (device ID for all power-managed devices)
|
||||
Return: after system is resumed
|
||||
CF clear
|
||||
Notes: if supported by the system's power supply, turns off the system power
|
||||
SeeAlso: AX=5307h/CX=0001h"STAND-BY",AX=530Bh
|
||||
--------p-155308-----------------------------
|
||||
INT 15 - Advanced Power Management v1.0+ - ENABLE/DISABLE POWER MANAGEMENT
|
||||
AX = 5308h
|
||||
BX = device ID for all devices power-managed by APM
|
||||
0001h (APM v1.1+)
|
||||
FFFFh (APM v1.0)
|
||||
CX = new state
|
||||
0000h disabled
|
||||
0001h enabled
|
||||
Return: CF clear if successful
|
||||
CF set on error
|
||||
AH = error code (01h,03h,09h,0Ah,0Bh) (see #00473)
|
||||
Notes: when power management is disabled, the system BIOS will not
|
||||
automatically power down devices, enter stand-by or suspended mode,
|
||||
or perform any power-saving actions in response to AX=5305h calls
|
||||
should not be called from within a hardware interrupt handler to avoid
|
||||
reentrance problems
|
||||
the APM BIOS should never be both disabled and disengaged at the same
|
||||
time
|
||||
SeeAlso: AX=5309h,AX=530Dh,AX=530Fh
|
||||
--------p-155309-----------------------------
|
||||
INT 15 - Advanced Power Management v1.0+ - RESTORE POWER-ON DEFAULTS
|
||||
AX = 5309h
|
||||
BX = device ID for all devices power-managed by APM
|
||||
0001h (APM v1.1)
|
||||
FFFFh (APM v1.0)
|
||||
Return: CF clear if successful
|
||||
CF set on error
|
||||
AH = error code (03h,09h,0Bh) (see #00473)
|
||||
Note: should not be called from within a hardware interrupt handler to avoid
|
||||
reentrance problems
|
||||
SeeAlso: AX=5308h
|
||||
--------p-15530A-----------------------------
|
||||
INT 15 - Advanced Power Management v1.0+ - GET POWER STATUS
|
||||
AX = 530Ah
|
||||
BX = device ID
|
||||
0001h all devices power-managed by APM
|
||||
80xxh specific battery unit number XXh (01h-FFh) (APM v1.2)
|
||||
Return: CF clear if successful
|
||||
BH = AC line status
|
||||
00h off-line
|
||||
01h on-line
|
||||
02h on backup power (APM v1.1)
|
||||
FFh unknown
|
||||
other reserved
|
||||
BL = battery status (see #00476)
|
||||
CH = battery flag (APM v1.1+) (see #00477)
|
||||
CL = remaining battery life, percentage
|
||||
00h-64h (0-100) percentage of full charge
|
||||
FFh unknown
|
||||
DX = remaining battery life, time (APM v1.1) (see #00478)
|
||||
---if specific battery unit specified---
|
||||
SI = number of battery units currently installed
|
||||
CF set on error
|
||||
AH = error code (09h,0Ah) (see #00473)
|
||||
Notes: should not be called from within a hardware interrupt handler to avoid
|
||||
reentrance problems
|
||||
supported in real mode (INT 15) and both 16-bit and 32-bit protected
|
||||
mode
|
||||
|
||||
(Table 00476)
|
||||
Values for APM v1.0+ battery status:
|
||||
00h high
|
||||
01h low
|
||||
02h critical
|
||||
03h charging
|
||||
FFh unknown
|
||||
other reserved
|
||||
SeeAlso: #00477,#00478
|
||||
|
||||
Bitfields for APM v1.1+ battery flag:
|
||||
Bit(s) Description (Table 00477)
|
||||
0 high
|
||||
1 low
|
||||
2 critical
|
||||
3 charging
|
||||
4 selected battery not present (APM v1.2)
|
||||
5-6 reserved (0)
|
||||
7 no system battery
|
||||
Note: all bits set (FFh) if unknown
|
||||
SeeAlso: #00476,#00478
|
||||
|
||||
Bitfields for APM v1.1+ remaining battery life:
|
||||
Bit(s) Description (Table 00478)
|
||||
15 time units: 0=seconds, 1=minutes
|
||||
14-0 battery life in minutes or seconds
|
||||
Note: all bits set (FFFFh) if unknown
|
||||
SeeAlso: #00476,#00477
|
||||
--------p-15530B-----------------------------
|
||||
INT 15 - Advanced Power Management v1.0+ - GET POWER MANAGEMENT EVENT
|
||||
AX = 530Bh
|
||||
Return: CF clear if successful
|
||||
BX = event code (see #00479)
|
||||
CX = event information (APM v1.2) if BX=0003h or BX=0004h
|
||||
bit 0: PCMCIA socket was powered down in suspend state
|
||||
CF set on error
|
||||
AH = error code (03h,0Bh,80h) (see #00473)
|
||||
Notes: although power management events are often asynchronous, notification
|
||||
will not be made until polled via this call to permit software to
|
||||
only receive event notification when it is prepared to process
|
||||
power management events; since these events are not very time-
|
||||
critical, it should be sufficient to poll once or twice per second
|
||||
the critical resume notification is made after the system resumes
|
||||
from an emergency suspension; normally, the system BIOS only notifies
|
||||
its partner that it wishes to suspend and relies on the partner to
|
||||
actually request the suspension, but no notification is made on an
|
||||
emergency suspension
|
||||
should not be called from within a hardware interrupt handler to avoid
|
||||
reentrance problems
|
||||
SeeAlso: AX=5307h,AX=5307h/CX=0001h"STAND-BY",AX=5307h/CX=0002h"SUSPEND"
|
||||
|
||||
(Table 00479)
|
||||
Values for APM event code:
|
||||
0001h system stand-by request
|
||||
0002h system suspend request
|
||||
0003h normal resume system notification
|
||||
0004h critical resume system notification
|
||||
0005h battery low notification
|
||||
---APM v1.1---
|
||||
0006h power status change notification
|
||||
0007h update time notification
|
||||
0008h critical system suspend notification
|
||||
0009h user system standby request notification
|
||||
000Ah user system suspend request notification
|
||||
000Bh system standby resume notification
|
||||
---APM v1.2---
|
||||
000Ch capabilities change notification (see AX=5310h)
|
||||
------
|
||||
000Dh-00FFh reserved system events
|
||||
01xxh reserved device events
|
||||
02xxh OEM-defined APM events
|
||||
0300h-FFFFh reserved
|
||||
--------p-15530C-----------------------------
|
||||
INT 15 - Advanced Power Management v1.1+ - GET POWER STATE
|
||||
AX = 530Ch
|
||||
BX = device ID (see #00474)
|
||||
Return: CF clear if successful
|
||||
CX = system state ID (see #00475)
|
||||
CF set on error
|
||||
AH = error code (01h,09h) (see #00473)
|
||||
SeeAlso: AX=5307h
|
||||
--------p-15530D-----------------------------
|
||||
INT 15 - Advanced Power Management v1.1+ - EN/DISABLE DEVICE POWER MANAGEMENT
|
||||
AX = 530Dh
|
||||
BX = device ID (see #00474)
|
||||
CX = function
|
||||
0000h disable power management
|
||||
0001h enable power management
|
||||
Return: CF clear if successful
|
||||
CF set on error
|
||||
AH = error code (01h,03h,09h,0Ah,0Bh) (see #00473)
|
||||
Desc: specify whether automatic power management should be active for a
|
||||
given device
|
||||
SeeAlso: AX=5308h,AX=530Fh
|
||||
--------p-15530E-----------------------------
|
||||
INT 15 - Advanced Power Management v1.1+ - DRIVER VERSION
|
||||
AX = 530Eh
|
||||
BX = device ID of system BIOS (0000h)
|
||||
CH = APM driver major version (BCD)
|
||||
CL = APM driver minor version (BCD) (02h for APM v1.2)
|
||||
Return: CF clear if successful
|
||||
AH = APM connection major version (BCD)
|
||||
AL = APM connection minor version (BCD)
|
||||
CF set on error
|
||||
AH = error code (03h,09h,0Bh) (see #00473)
|
||||
SeeAlso: AX=5300h,AX=5303h
|
||||
--------p-15530F-----------------------------
|
||||
INT 15 - Advanced Power Management v1.1+ - ENGAGE/DISENGAGE POWER MANAGEMENT
|
||||
AX = 530Fh
|
||||
BX = device ID (see #00474)
|
||||
CX = function
|
||||
0000h disengage power management
|
||||
0001h engage power management
|
||||
Return: CF clear if successful
|
||||
CF set on error
|
||||
AH = error code (01h,09h) (see #00473)
|
||||
Notes: unlike AX=5308h, this call does not affect the functioning of the APM
|
||||
BIOS
|
||||
when cooperative power management is disengaged, the APM BIOS performs
|
||||
automatic power management of the system or device
|
||||
SeeAlso: AX=5308h,AX=530Dh
|
||||
--------p-155310-----------------------------
|
||||
INT 15 - Advanced Power Management v1.2 - GET CAPABILITIES
|
||||
AX = 5310h
|
||||
BX = device ID (see #00474)
|
||||
0000h (APM BIOS)
|
||||
other reserved
|
||||
Return: CF clear if successful
|
||||
BL = number of battery units supported (00h if no system batteries)
|
||||
CX = capabilities flags (see #00480)
|
||||
CF set on error
|
||||
AH = error code (01h,09h,86h) (see #00473)
|
||||
Notes: this function is supported via the INT 15, 16-bit protected mode, and
|
||||
32-bit protected mode interfaces; it does not require that a
|
||||
connection be established prior to use
|
||||
this function will return the capabilities currently in effect, not
|
||||
any new settings which have been made but do not take effect until
|
||||
a system restart
|
||||
SeeAlso: AX=5300h,AX=530Fh,AX=5311h,AX=5312h,AX=5313h
|
||||
|
||||
Bitfields for APM v1.2 capabilities flags:
|
||||
Bit(s) Description (Table 00480)
|
||||
15-8 reserved
|
||||
7 PCMCIA Ring Indicator will wake up system from suspend mode
|
||||
6 PCMCIA Ring Indicator will wake up system from standby mode
|
||||
5 Resume on Ring Indicator will wake up system from suspend mode
|
||||
4 Resume on Ring Indicator will wake up system from standby mode
|
||||
3 resume timer will wake up system from suspend mode
|
||||
2 resume timer will wake up system from standby mode
|
||||
1 can enter global suspend state
|
||||
0 can enter global standby state
|
||||
--------p-155311-----------------------------
|
||||
INT 15 - Advanced Power Management v1.2 - GET/SET/DISABLE RESUME TIMER
|
||||
AX = 5311h
|
||||
BX = device ID (see #00474)
|
||||
0000h (APM BIOS)
|
||||
other reserved
|
||||
CL = function
|
||||
00h disable Resume Timer
|
||||
01h get Resume Timer
|
||||
02h set Resume Timer
|
||||
CH = resume time, seconds (BCD)
|
||||
DL = resume time, minutes (BCD)
|
||||
DH = resume time, hours (BCD)
|
||||
SI = resume date (BCD), high byte = month, low byte = day
|
||||
DI = resume date, year (BCD)
|
||||
Return: CF clear if successful
|
||||
---if getting timer---
|
||||
CH = resume time, seconds (BCD)
|
||||
DL = resume time, minutes (BCD)
|
||||
DH = resume time, hours (BCD)
|
||||
SI = resume date (BCD), high byte = month, low byte = day
|
||||
DI = resume date, year (BCD)
|
||||
CF set on error
|
||||
AH = error code (03h,09h,0Ah,0Bh,0Ch,0Dh,86h) (see #00473)
|
||||
Notes: this function is supported via the INT 15, 16-bit protected mode, and
|
||||
32-bit protected mode interfaces
|
||||
SeeAlso: AX=5300h,AX=5310h,AX=5312h,AX=5313h
|
||||
--------p-155312-----------------------------
|
||||
INT 15 - Advanced Power Management v1.2 - ENABLE/DISABLE RESUME ON RING
|
||||
AX = 5312h
|
||||
BX = device ID (see #00474)
|
||||
0000h (APM BIOS)
|
||||
other reserved
|
||||
CL = function
|
||||
00h disable Resume on Ring Indicator
|
||||
01h enable Resume on Ring Indicator
|
||||
02h get Resume on Ring Indicator status
|
||||
Return: CF clear if successful
|
||||
CX = resume status (0000h disabled, 0001h enabled)
|
||||
CF set on error
|
||||
AH = error code (03h,09h,0Ah,0Bh,0Ch,86h) (see #00473)
|
||||
Notes: this function is supported via the INT 15, 16-bit protected mode, and
|
||||
32-bit protected mode interfaces
|
||||
SeeAlso: AX=5300h,AX=5310h,AX=5311h,AX=5313h
|
||||
--------p-155313-----------------------------
|
||||
INT 15 - Advanced Power Management v1.2 - ENABLE/DISABLE TIMER-BASED REQUESTS
|
||||
AX = 5313h
|
||||
BX = device ID (see #00474)
|
||||
0000h (APM BIOS)
|
||||
other reserved
|
||||
CL = function
|
||||
00h disable timer-based requests
|
||||
01h enable timer-based requests
|
||||
02h get timer-based requests status
|
||||
Return: CF clear if successful
|
||||
CX = timer-based requests status (0000h disabled, 0001h enabled)
|
||||
CF set on error
|
||||
AH = error code (03h,09h,0Ah,0Bh,86h) (see #00473)
|
||||
Notes: this function is supported via the INT 15, 16-bit protected mode, and
|
||||
32-bit protected mode interfaces
|
||||
some BIOSes set AH on return even when successful
|
||||
SeeAlso: AX=5300h,AX=5310h,AX=5311h,AX=5312h
|
@ -1,225 +0,0 @@
|
||||
$Revision: 425 $
|
||||
;
|
||||
; MEMORY MAP
|
||||
;
|
||||
; Boot:
|
||||
;
|
||||
; 0:9000 byte bits per pixel
|
||||
; 0:9001 word scanline length
|
||||
; 0:9008 word vesa video mode
|
||||
; 0:900A word X res
|
||||
; 0:900C word Y res
|
||||
; 0:9010 byte mouse port - not used
|
||||
; 0:9014 dword Vesa 1.2 pm bank switch
|
||||
; 0:9018 dword Vesa 2.0 LFB address
|
||||
; 0:901C byte 0 or 1 : enable MTRR graphics acceleration
|
||||
; 0:901D byte not used anymore (0 or 1 : enable system log display)
|
||||
; 0:901E byte 0 or 1 : enable direct lfb write, paging disabled
|
||||
; 0:901F byte DMA write : 1=yes, 2=no
|
||||
; 0:9020 8bytes pci data
|
||||
; 0:9030 byte VRR start enabled 1, 2-no
|
||||
; 0:9031 word IDEContrRegsBaseAddr
|
||||
; 0x9040 - dword - entry point of APM BIOS
|
||||
; 0x9044 - word - version (BCD)
|
||||
; 0x9046 - word - flags
|
||||
;
|
||||
; Runtime:
|
||||
;
|
||||
; 0000 -> 1FFF window_data - 256 entries
|
||||
;
|
||||
; 0000 dword x start
|
||||
; 0004 dword y start
|
||||
; 0008 dword x size
|
||||
; 000C dword y size
|
||||
; 0010 dword color of work area
|
||||
; 0014 dword color of grab bar
|
||||
; 0018 dword color of frames
|
||||
; 001C dword window flags, +30 = window drawn, +31 redraw flag
|
||||
;
|
||||
; 2000 -> 2FFF free
|
||||
;
|
||||
; 3000 -> 4FFF task list - 256 entries
|
||||
;
|
||||
; 00 dword process count
|
||||
; 04 dword no of processes
|
||||
; 10 dword base of running process at 0x3000+
|
||||
;
|
||||
; 20 dword application event mask
|
||||
; 24 dword PID - process identification number
|
||||
; 2a byte slot state: 0=running, 1,2=suspended
|
||||
; 3=zombie, 4=terminate,
|
||||
; 5=waiting for event, 9 = not used
|
||||
; 2e byte window number on screen
|
||||
; 30 dword exact position in memory
|
||||
; 34 dword counter sum
|
||||
; 38 dword time stamp counter add
|
||||
; 3c dword cpu usage in cpu timer tics
|
||||
;
|
||||
;
|
||||
; 5000 -> 68FF free
|
||||
; 6900 -> 6EFF saved picture under mouse pointer
|
||||
;
|
||||
; 6F00 -> 6FFF free
|
||||
;
|
||||
; 7000 -> 7FFF used CD driver
|
||||
;
|
||||
; 8000 -> A3FF used FLOPPY driver
|
||||
;
|
||||
; A400 -> B0FF free
|
||||
|
||||
; B100 -> B2FF IDT
|
||||
|
||||
; B300 -> BFFF free
|
||||
|
||||
; C000 -> C3FF window stack C000 no of windows - all in words
|
||||
; C402 -> C7FF window position in stack
|
||||
; D000 -> D1FF FDC controller
|
||||
; D200 -> D3FF FDC controller for Fat12
|
||||
; D400 -> DFFF free
|
||||
; E000 byte multitasking started
|
||||
; E020 dword putpixel address
|
||||
; E024 dword getpixel address
|
||||
; E030 dword Vesa 1.2 pm bank switch address
|
||||
; F200 dword mousepicture -pointer
|
||||
; F204 dword mouse appearance counter
|
||||
; F300 dword x & y temp for windowmove
|
||||
; 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 mouse port: 1 ps2, 2 com1, 3 com2
|
||||
; FB00 -> FB0F mouse memory 00 chunk count - FB0A-B x - FB0C-D y
|
||||
; 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
|
||||
; FCFF com1/ps2 buffer count starting from FC00
|
||||
; FE00 dword screen x size
|
||||
; FE04 dword screen y size
|
||||
; FE08 dword screen y multiplier
|
||||
; FE0C dword screen mode
|
||||
; FE80 dword address of LFB in physical
|
||||
; FE84 dword address of applications memory start in physical
|
||||
; FE88 dword address of button list
|
||||
; FE8C dword memory to use
|
||||
; FF00 byte 1 = system shutdown request
|
||||
; FF01 dword free
|
||||
; FFF0 byte 1 = redraw background request from app
|
||||
; FFF1 byte 1 = diskette int occur
|
||||
; FFF2 write and read bank in screen
|
||||
; FFF4 byte 0 if first mouse draw & do not return picture under
|
||||
; FFF5 byte 1 do not draw pointer
|
||||
; FFFF byte do not change task for 1/100 sec.
|
||||
;
|
||||
; 10000 -> 3DBFF kernel, 32-bit run-time code (up to 183 Kb)
|
||||
; 3DC00 -> 3EBFF stack at boot time (4Kb)
|
||||
; 3EC00 -> 3F5FF basic text font II
|
||||
; 3F600 -> 3FFFF basic text font I
|
||||
; 40000 -> 4FFFF data of retrieved disks and partitions (Mario79)
|
||||
|
||||
; 50000 -> 50FFF main page directory
|
||||
; 50200 -> 5FFFF pages bitmap
|
||||
|
||||
; 60000 -> 7FFFF free (128 Kb)
|
||||
; 80000 -> 8FFFF additional app info, in 256 byte steps - 256 entries
|
||||
;
|
||||
; 00 11db name of app running
|
||||
; 10 108db floating point unit save area
|
||||
; 7f byte 0= no fpu saved , 1= fpu saved to 0x10 -> restore
|
||||
; 80 dword address of random shaped window area
|
||||
; 84 byte shape area scale
|
||||
; 88 dword free
|
||||
; 8C dword application memory size
|
||||
; 90 dword window X position save
|
||||
; 94 dword window Y position save
|
||||
; 98 dword window X size save
|
||||
; 9C dword window Y size save
|
||||
; A0 dword IPC memory start
|
||||
; A4 dword IPC memory size
|
||||
; A8 dword event bits: mouse, stack,..
|
||||
; AC dword 0 or debugger slot
|
||||
; B0 dword free
|
||||
; B4 byte keyboard mode: 0 = keymap, 1 = scancodes
|
||||
; B8 dword physical address of directory table
|
||||
; BC dword address of debug event memory
|
||||
; C0 5 dd thread debug registers: DR0,DR1,DR2,DR3,DR7
|
||||
;
|
||||
; 90000 -> 9FFFF tmp
|
||||
; A0000 -> AFFFF screen access area
|
||||
; B0000 -> FFFFF bios rest in peace -area
|
||||
; 100000 -> 27FFFF diskette image
|
||||
; 280000 -> 281FFF ramdisk fat
|
||||
; 282000 -> 283FFF floppy fat
|
||||
;
|
||||
; 284000 -> 29FFFF free (112 Kb)
|
||||
;
|
||||
; 2A0000 -> 2B00ff wav device data
|
||||
; 2C0000 -> 2C3fff button info
|
||||
;
|
||||
; 0000 word number of buttons
|
||||
; first button entry at 0x10
|
||||
; +0000 word process number
|
||||
; +0002 word button id number : bits 00-15
|
||||
; +0004 word x start
|
||||
; +0006 word x size
|
||||
; +0008 word y start
|
||||
; +000A word y size
|
||||
; +000C word button id number : bits 16-31
|
||||
;
|
||||
; 2C4000 -> 2CFFFF free (48Kb)
|
||||
;
|
||||
; 2D0000 -> 2DFFFF reserved port area
|
||||
;
|
||||
; 0000 dword no of port areas reserved
|
||||
; 0010 dword process id
|
||||
; dword start port
|
||||
; dword end port
|
||||
; dword 0
|
||||
;
|
||||
; 2E0000 -> 2EFFFF irq data area
|
||||
; 2F0000 -> 2FFFFF low memory save
|
||||
;
|
||||
; 300000 -> 45FFFF background image, max 1,375 M
|
||||
;
|
||||
; 460000 -> 5FFFFF display info
|
||||
;
|
||||
; 600000 -> 6FFFFF hd cache
|
||||
;
|
||||
; 700000 -> 71ffff tcp memory (128 kb)
|
||||
; 720000 -> 75ffff free (256 kb)
|
||||
;
|
||||
; 760000 -> 76ffff !vrr driver
|
||||
; 770000 -> 777fff tcp memory ( 32 kb)
|
||||
;
|
||||
; 780000 -> 987FFF TSS and IO map for (8192*8)=65536 ports
|
||||
; (128+8192)*256 = 2129920 = 0x208000
|
||||
;
|
||||
; 988000 -> 98AFFF draw_data - 256 entries
|
||||
;
|
||||
; 00 dword draw limit - x start
|
||||
; 04 dword draw limit - y start
|
||||
; 08 dword draw limit - x end
|
||||
; 0C dword draw limit - y end
|
||||
;
|
||||
;
|
||||
; 0x0098B000 -> kernel heap
|
||||
;
|
||||
; 0x01FFFFFF heap min limit
|
||||
; 0x7DBFFFFF heap max limit
|
||||
; 0x7DC00000 -> 0x7FBFFFFF LFB 32Mb
|
||||
; 0x7DC00000 -> 0x7E3FFFFF application available LFB 8Mb
|
||||
; 0x7E400000 -> 0x7FBFFFFF kernel LFB part 24 Mb
|
||||
; 0x7FC00000 -> 0x7FFFFFFF page tables 4Mb
|
||||
; 0x80000000 -> 0xFFFFFFFF application 2Gb
|
||||
|
||||
|
||||
|
@ -1,53 +0,0 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved.
|
||||
;; PROGRAMMING:
|
||||
;; Ivan Poddubny
|
||||
;; Marat Zakiyanov (Mario79)
|
||||
;; VaStaNi
|
||||
;; Trans
|
||||
;; Mihail Semenyako (mike.dld)
|
||||
;; Sergey Kuzmin (Wildwest)
|
||||
;; Andrey Halyavin (halyavin)
|
||||
;; Mihail Lisovin (Mihasik)
|
||||
;; Andrey Ignatiev (andrew_programmer)
|
||||
;; NoName
|
||||
;; Evgeny Grechnikov (Diamond)
|
||||
;; Iliya Mihailov (Ghost)
|
||||
;; Sergey Semyonov (Serge)
|
||||
;; Johnny_B
|
||||
;;
|
||||
;; 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
|
||||
;; part of KolibriOS project under the terms of GNU GPL.
|
||||
;;
|
||||
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa
|
||||
;; PROGRAMMING:
|
||||
;;
|
||||
;; Ville Mikael Turjanmaa, villemt@itu.jyu.fi
|
||||
;; - main os coding/design
|
||||
;; Jan-Michael Brummer, BUZZ2@gmx.de
|
||||
;; Felix Kaiser, info@felix-kaiser.de
|
||||
;; Paolo Minazzi, paolo.minazzi@inwind.it
|
||||
;; quickcode@mail.ru
|
||||
;; Alexey, kgaz@crosswinds.net
|
||||
;; Juan M. Caravaca, bitrider@wanadoo.es
|
||||
;; kristol@nic.fi
|
||||
;; Mike Hibbett, mikeh@oceanfree.net
|
||||
;; Lasse Kuusijarvi, kuusijar@lut.fi
|
||||
;; Jarek Pelczar, jarekp3@wp.pl
|
||||
;;
|
||||
;; KolibriOS is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
;; WARRANTY. No author or distributor accepts responsibility to anyone for the
|
||||
;; consequences of using it or for whether it serves any particular purpose or
|
||||
;; works at all, unless he says so in writing. Refer to the GNU General Public
|
||||
;; License (the "GPL") for full details.
|
||||
;
|
||||
;; Everyone is granted permission to copy, modify and redistribute KolibriOS,
|
||||
;; but only under the conditions described in the GPL. A copy of this license
|
||||
;; is supposed to have been given to you along with KolibriOS so you can know
|
||||
;; your rights and responsibilities. It should be in a file named COPYING.
|
||||
;; Among other things, the copyright notice and this notice must be preserved
|
||||
;; on all copies.
|
||||
;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user