small change. Add make a fdd image.

git-svn-id: svn://kolibrios.org@1151 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Alexey Teplov ( 2009-09-07 16:56:59 +00:00
parent 8861a95ef3
commit 3146588b83
13 changed files with 2293 additions and 1428 deletions

View File

@ -13,4 +13,8 @@ echo ==============================
echo ** building firs loader for fat32 **
@fasm -m 65535 fat32/bootsect.asm fat32/bootsect.bin
@fasm -m 65535 fat32/kordldr.f1x.asm fat32/kordldr.f1x
echo ==============================
echo ** make a image of fdd **
@fasm -m 65535 floppy.asc kord.img
@pause

View File

@ -0,0 +1,49 @@
include "mkfloppy.inc"
;// insert boot sect
file "fat1x/bootsect.bin", 512
; fat1
db 0F0h, 0FFh, 0FFh, 9*512-3 dup 0
; fat2
db 0F0h, 0FFh, 0FFh, 9*512-3 dup 0
; root
dent kordldr, "KORDLDR F1X", FA_ARC
dent kord, "KORD ",FA_DIR
dent kolibri, "KOLIBRI ",FA_DIR
; ...
rb 33*512-$
;///////////////////////////
defdir kord
{
dent loader, "LOADER ", FA_ARC
dent ini,"STARTOS INI", FA_ARC
}
defdir kolibri
{
dent kolibri_ldm, "KOLIBRI LDM", FA_ARC
}
; data
stof kordldr, "fat1x/kordldr.f1x"
stod kord,root
stof loader, "../loader"
stof ini,"../startos.ini"
store dword ini_base/512+1 at ini_base+1F8h
store word (ini_size+511)/512-1 at ini_base+1FCh
store word 220h at ini_base+1FEh
stod kolibri,root
stof kolibri_ldm, "../kolibri_ldm/bin/kolibri.ldm"
store dword kolibri_ldm_base/512+1 at kolibri_ldm_base+1F8h
store word (kolibri_ldm_size+511)/512-1 at kolibri_ldm_base+1FCh
store word 220h at kolibri_ldm_base+1FEh
; ...
rb 2*80*18*512-$

View File

@ -0,0 +1,90 @@
; ---------------------------------------------------------------------------
; mkfloppy.inc
; ---------------------------------------------------------------------------
; Created by Phantom-84
; ---------------------------------------------------------------------------
FA_RO equ 01h
FA_HID equ 02h
FA_SYS equ 04h
FA_VOL equ 08h
FA_DIR equ 10h
FA_ARC equ 20h
DSTAMP equ 28C1h
TSTAMP equ 6000h
root_size=0
macro reset id
{
local count, cur, disp, val, var
times 511-($+511) mod 512 db 0
if id#_size>0
count=(id#_size+511)/512
cur=id#_base/512-(33-2)
repeat count
if %=count
val=0FFFh
else
val=cur+1
end if
if cur and 1
val=val shl 4
end if
disp=(cur*3)/2
load var word from 512+disp
var=var or val
store word var at 512+disp
store word var at 10*512+disp
cur=cur+1
end repeat
end if
}
macro dent id, name, attr
{
@@ db name
times @b+11-$ db 32
db attr
dw 0, TSTAMP, DSTAMP, DSTAMP, 0, TSTAMP, DSTAMP
if id#_size=0
dw 0
else
dw id#_base/512-(33-2)
end if
if (attr) and FA_DIR
dd 0
else
dd id#_size
end if
}
macro orgdir id, parentid
{
id#_base:
dent id, ".", FA_DIR
dent parentid, "..", FA_DIR
}
macro findir id
{
id#_size=$-id#_base
reset id
}
macro stod id, parentid
{
orgdir id, parentid
id
findir id
}
macro stof id, name
{
id#_base: file name
id#_size=$-id#_base
reset id
}
defdir fix macro

View File

@ -31,14 +31,14 @@
;======================================================================
version db 'Secondary Loader v 0.009',0
version db 'Secondary Loader v 0.010',0
version_end:
select_section db 'Select section:'
select_section_end:
section_description db 'Section description:'
section_description_end:
soft_mes db 'Soft (c) 2008'
soft_mes db 'Soft (c) 2008-2009'
soft_mes_end:
badprocessor db '>Fatal - CPU 586+ required.',0
@ -58,7 +58,7 @@ load_ini db '>Ini file loaded successfully',0
parse_ini_end db '>End parsing ini file',0
point_to_default_sec_not_found db '>Point to default section is not found in ini file',0
incorect_section_define db ">Incorect section define not found ']'",0
default_section_name db '"Section unname"'
default_section_name db '"Section unname"'
start_msg db "Press any key to change default section, press [Enter] to continue booting"
start_msg_e:

View File

@ -26,11 +26,12 @@
;Òóò îïðåäåëåíû âñå ñîîáùåíèÿ, êîòîðûå íóæíû â ïðîöåññå îòëàäêè, è ñîâñåì íå íóæíû â ðàáî÷åé êîïèè ïðîãðàììû.
If DEBUG
stack_msg db 'Set stack & segments is have completed',0
show_string db 'Have loaded size:'
show_decode db ' ',0
show_db1 db ' -Message debug1',0
show_db2 db ' -Message debug2',0
cseg_msg db ' - Adress of code segment',0
stack_msg db 'Set stack & segments is have completed',0
show_string db 'Have loaded size:'
show_decode db ' ',0
show_db1 db ' -Message debug1',0
show_db2 db ' -Message debug2',0
lm_l_found db '[loader] is found',0
@ -45,23 +46,24 @@ _not_found db '[ not found',0
_found_1 db '[] found',0
_found_2 db '[ found',0
say_hello db 'Hello $)',0
ramdiskFS_st db 'Start use_RamdiskFS macros',0
ramdiskFS_st db 'Start use_RamdiskFS macros',0
free_memory_msg db ' -Kb availability system free memory',0
RamdiskSize_msg db ' -Kb equal RamdiskSize',0
RamdiskSector_msg db ' -byts RamdiskSector',0
RamdiskCluster_msg db ' -RamdiskCluster',0
RamdiskFile_msg db ' -size RamdiskFile',0
fat_create_msg db ' -first create fat table, point to next block',0
BPB_msg db ' -in byte, why we get data from move BPB struct',0
RamdiskFile_msg db ' -size RamdiskFile',0
fat_create_msg db ' -first create fat table, point to next block',0
BPB_msg db ' -in byte, why we get data from move BPB struct',0
firstDataSect_msg db ' -first data sector, offset to data in sectors',0
size_root_dir_msg db ' -size root dir in sectrors',0
DataClasters_msg db ' -size data in Clasters',0
check_name_fat_msg db ' -if -1 name is present, else 0 then not present name',0
convertion_file_name_msg db ' -if -1, then destination name is bad',0
convertion_file_name_msg db ' -if -1, then destination name of file is bad',0
start_making_FAT12_msg db '>>>>>> Begin making fat12 FS on RAMDISK <<<<<<<',0
make_fat12_RFS_msg db '-Make FAT12 Ram FS',0
get_type_FS_msg db '-End make RamDisk',0
return_code_af_move db ' -return code after 0x87 int 0x15, move block',0
return_code_af_fat_m db ' -return code after 0x87 int 0x15, move fat struc',0
return_code_af_move db ' -return code after 0x87 int 0x15, move block',0
return_code_af_fat_m db ' -return code after 0x87 int 0x15, move fat struc',0

View File

@ -0,0 +1,635 @@
; Listing generator
; LocoDelAssembly 2007.06.01
INSTRUCTIONS equ bt in ja jb jc je jg jl jo jp js jz or \
aaa aad aam aas adc add and bsf bsr btc btr bts cbw cdq clc \
cld cli cmc cmp cqo cwd daa das dec div fld fst hlt inc ins \
int jae jbe jge jle jmp jna jnb jnc jne jng jnl jno jnp jns \
jnz jpe jpo lar lds lea les lfs lgs lsl lss ltr mov mul neg \
nop not out pop por rcl rcr ret rol ror rsm sal sar sbb shl \
shr stc std sti str sub ud2 xor \
arpl call cdqe clgi clts cmps cwde emms fabs fadd fbld fchs \
fcom fcos fdiv feni fild fist fld1 fldz fmul fnop fsin fstp \
fsub ftst fxam fxch idiv imul insb insd insw int1 int3 into \
invd iret jcxz jnae jnbe jnge jnle lahf lgdt lidt lldt lmsw \
lods loop movd movq movs orpd orps outs pand popa popd popf \
popq popw push pxor retd retf retn retq retw sahf salc scas \
seta setb setc sete setg setl seto setp sets setz sgdt shld \
shrd sidt sldt smsw stgi stos test verr verw wait xadd xchg \
xlat \
addpd addps addsd addss andpd andps bound bswap cmova cmovb \
cmovc cmove cmovg cmovl cmovo cmovp cmovs cmovz cmppd cmpps \
cmpsb cmpsd cmpsq cmpss cmpsw cpuid divpd divps divsd divss \
enter f2xm1 faddp fbstp fclex fcomi fcomp fdisi fdivp fdivr \
femms ffree fiadd ficom fidiv fimul finit fistp fisub fldcw \
fldpi fmulp fneni fprem fptan fsave fsqrt fstcw fstsw fsubp \
fsubr fucom fwait fyl2x icebp iretd iretq iretw jecxz jrcxz \
lddqu leave lodsb lodsd lodsq lodsw loopd loope loopq loopw \
loopz maxpd maxps maxsd maxss minpd minps minsd minss movsb \
movsd movsq movss movsw movsx movzx mulpd mulps mulsd mulss \
mwait outsb outsd outsw pabsb pabsd pabsw paddb paddd paddq \
paddw pandn pause pavgb pavgw pf2id pf2iw pfacc pfadd pfmax \
pfmin pfmul pfrcp pfsub pi2fd pi2fw popad popaw popfd popfq \
popfw pslld psllq psllw psrad psraw psrld psrlq psrlw psubb \
psubd psubq psubw pusha pushd pushf pushq pushw rcpps rcpss \
rdmsr rdpmc rdtsc retfd retfq retfw retnd retnq retnw scasb \
scasd scasq scasw setae setbe setge setle setna setnb setnc \
setne setng setnl setno setnp setns setnz setpe setpo stosb \
stosd stosq stosw subpd subps subsd subss vmrun vmxon wrmsr \
xlatb xorpd xorps \
andnpd andnps cmovae cmovbe cmovge cmovle cmovna cmovnb cmovnc\
cmovne cmovng cmovnl cmovno cmovnp cmovns cmovnz cmovpe cmovpo\
comisd comiss fcmovb fcmove fcmovu fcomip fcompp fdivrp ffreep\
ficomp fidivr fisttp fisubr fldenv fldl2e fldl2t fldlg2 fldln2\
fnclex fndisi fninit fnsave fnstcw fnstsw fpatan fprem1 frstor\
frstpm fscale fsetpm fstenv fsubrp fucomi fucomp fxsave haddpd\
haddps hsubpd hsubps invlpg lfence looped loopeq loopew loopne\
loopnz loopzd loopzq loopzw mfence movapd movaps movdqa movdqu\
movhpd movhps movlpd movlps movnti movntq movsxd movupd movups\
paddsb paddsw pextrw pfnacc pfsubr phaddd phaddw phsubd phsubw\
pinsrw pmaxsw pmaxub pminsw pminub pmulhw pmullw psadbw pshufb\
pshufd pshufw psignb psignd psignw pslldq psrldq psubsb psubsw\
pswapd pushad pushaw pushfd pushfq pushfw rdmsrq rdtscp setalc\
setnae setnbe setnge setnle sfence shufpd shufps skinit sqrtpd\
sqrtps sqrtsd sqrtss swapgs sysret vmcall vmload vmread vmsave\
vmxoff wbinvd wrmsrq \
clflush cmovnae cmovnbe cmovnge cmovnle cmpeqpd cmpeqps \
cmpeqsd cmpeqss cmplepd cmpleps cmplesd cmpless cmpltpd \
cmpltps cmpltsd cmpltss cmpxchg fcmovbe fcmovnb fcmovne \
fcmovnu fdecstp fincstp fnstenv frndint fsincos fucomip \
fucompp fxrstor fxtract fyl2xp1 invlpga ldmxcsr loopned \
loopneq loopnew loopnzd loopnzq loopnzw monitor movddup \
movdq2q movhlps movlhps movntdq movntpd movntps movq2dq \
paddusb paddusw palignr pavgusb pcmpeqb pcmpeqd pcmpeqw \
pcmpgtb pcmpgtd pcmpgtw pfcmpeq pfcmpge pfcmpgt pfpnacc \
pfrsqrt phaddsw phsubsw pmaddwd pmulhrw pmulhuw pmuludq \
pshufhw pshuflw psubusb psubusw rsqrtps rsqrtss stmxcsr \
syscall sysexit sysretq ucomisd ucomiss vmclear vmmcall \
vmptrld vmptrst vmwrite \
addsubpd addsubps cmpneqpd cmpneqps cmpneqsd cmpneqss cmpnlepd\
cmpnleps cmpnlesd cmpnless cmpnltpd cmpnltps cmpnltsd cmpnltss\
cmpordpd cmpordps cmpordsd cmpordss cvtdq2pd cvtdq2ps cvtpd2dq\
cvtpd2pi cvtpd2ps cvtpi2pd cvtpi2ps cvtps2dq cvtps2pd cvtps2pi\
cvtsd2si cvtsd2ss cvtsi2sd cvtsi2ss cvtss2sd cvtss2si fcmovnbe\
maskmovq movmskpd movmskps movshdup movsldup packssdw packsswb\
packuswb pfrcpit1 pfrcpit2 pfrsqit1 pmovmskb pmulhrsw prefetch\
sysenter sysexitq unpckhpd unpckhps unpcklpd unpcklps vmlaunch\
vmresume \
cmpxchg8b cvttpd2dq cvttpd2pi cvttps2dq cvttps2pi cvttsd2si \
cvttss2si pmaddubsw prefetchw punpckhbw punpckhdq punpckhwd \
punpcklbw punpckldq punpcklwd \
cmpunordpd cmpunordps cmpunordsd cmpunordss cmpxchg16b \
loadall286 loadall386 maskmovdqu prefetcht0 prefetcht1 \
prefetcht2 punpckhqdq punpcklqdq prefetchnta
PREFIXES equ rep lock repe repz repne repnz
DATA_DEFINITORS equ db dw du dd dp df dq dt file
DATA_RESERVERS equ rb rw rd rp rf rq rt
CRLF equ 13, 10 ; Remove 13 for Linux
MAX_BYTES equ 13
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MODE MACROSES ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
macro use16
{
use16
_USE = 16
}
macro use32
{
use32
_USE = 32
}
macro use64
{
use64
_USE = 64
}
macro detect_mode
{
local aux
_USE = 32
virtual at 0
xchg eax, eax
load aux byte from 0
if aux = $66
_USE = 16
else if aux = $87
_USE = 64
end if
end virtual
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;; DISPLAYING MACROSES ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
macro display_address address*
{
local aux, digit
aux = address
repeat _USE / 4
digit = aux shr (_USE - 4 * %) and $F
display digit + '0' + ('9' - 'B') and (9 - digit) shr 4 and $F
end repeat
display ': '
}
macro display_bytes pointer
{
local aux, size, digit
size = $ - pointer
if size > MAX_BYTES
size = MAX_BYTES
end if
repeat size
load aux byte from pointer+%-1
digit = aux shr 4
display digit + '0' + ('9' - 'B') and (9 - digit) shr 4 and $F
digit = aux and $F
display digit + '0' + ('9' - 'B') and (9 - digit) shr 4 and $F
display ' '
end repeat
repeat MAX_BYTES - size
display ' '
end repeat
}
; The macro below in some situations doesn't adds a space to separate things unfortunatelly, so for readability ensurance
; another one will be used instead...
;macro display_args [args]
;{
;common
; aux = 1
;
;forward
; if ~args eq
; if aux
; display ' '
; else
; display ', '
; end if
;
; aux = 0
;
; match =ON, _RESOLVE_EQUATES
; \{
; match args, args
; \\{
; irps arg, args
; \\\{
; display \\\`arg
; \\\}
; \\}
; \}
; match =OFF, _RESOLVE_EQUATES
; \{
; irps arg, args
; \\{
; display \\`arg
; \\}
;
; \}
; end if
;}
; This one separates everything with one space. A very ugly listing but at least you will not see things
; like "push ebxesiedi" nor "ret word0"
macro display_args [args]
{
common
aux = 1
forward
if ~args eq
if ~aux
display ','
end if
aux = 0
match =ON, _RESOLVE_EQUATES
\{
match args, args
\\{
if ~args eqtype ""
irps arg, args
\\\{
display ' ', \\\`arg
\\\}
else
display " '", args, "'"
end if
\\}
\}
match =OFF, _RESOLVE_EQUATES
\{
if ~args eqtype ""
irps arg, args
\\{
display ' ', \\`arg
\\}
else
display " '", args, "'"
end if
\}
end if
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;; INSTRUCTIONS & PREFIXES MACROSES ;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
macro prefix mnemonic
{
local aux
macro mnemonic [args]
\{
\common
match =1, _ON_VIRTUAL\\{_LISTING equ 0\\}
match =equ, args\\{_LISTING equ 0\\}
match =equ any, args\\{_LISTING equ 0\\}
match =1, _LISTING
\\{
display_address $
aux = $
\\}
mnemonic
match =1, _LISTING
\\{
display_bytes aux
display \`mnemonic
display CRLF
\\}
match =1, _ON_VIRTUAL\\{restore _LISTING\\}
match =equ, args\\{restore _LISTING\\}
match =equ any, args\\{restore _LISTING\\}
def_prefix mnemonic
args
purge mnemonic
\}
}
macro def_prefix mnemonic
{
macro def_prefix mnemonic
\{
prefix mnemonic
\}
def_prefix mnemonic
}
macro instruction mnemonic
{
local aux
macro mnemonic [args]
\{
\common
match =1, _ON_VIRTUAL\\{_LISTING equ 0\\}
match =equ, args\\{_LISTING equ 0\\}
match =equ any, args\\{_LISTING equ 0\\}
match =1, _LISTING
\\{
display_address $
aux = $
\\}
mnemonic args
match =1, _LISTING
\\{
display_bytes aux
display \`mnemonic
virtual at 0
db \`mnemonic
repeat 11 - $
display ' '
end repeat
end virtual
display_args args
display CRLF
\\}
match =1, _ON_VIRTUAL\\{restore _LISTING\\}
match =equ, args\\{restore _LISTING\\}
match =equ any, args\\{restore _LISTING\\}
\}
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DATA MACROSES ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
macro data_define mnemonic
{
local aux
macro mnemonic [args]
\{
\common
match =1, _ON_VIRTUAL\\{_LISTING equ 0\\}
match =equ, args\\{_LISTING equ 0\\}
match =equ any, args\\{_LISTING equ 0\\}
match =1, _LISTING
\\{
display_address $
aux = $
\\}
mnemonic args
match =1, _LISTING
\\{
display_bytes aux
display \`mnemonic
display_args args
display CRLF
aux = aux + MAX_BYTES
repeat ($ - aux + MAX_BYTES - 1) / MAX_BYTES
display_address aux
display_bytes aux
display CRLF
aux = aux + MAX_BYTES
end repeat
\\}
match =1, _ON_VIRTUAL\\{restore _LISTING\\}
match =equ, args\\{restore _LISTING\\}
match =equ any, args\\{restore _LISTING\\}
\}
struc mnemonic [args]
\{
\common
match =1, _ON_VIRTUAL\\{_LISTING equ 0\\}
match =equ, args\\{_LISTING equ 0\\}
match =equ any, args\\{_LISTING equ 0\\}
match =1, _LISTING
\\{
display_address $
aux = $
\\}
. mnemonic args
match =1, _LISTING
\\{
display_bytes aux
display \`., ' ', \`mnemonic
display_args args
display CRLF
aux = aux + MAX_BYTES
repeat ($ - aux + MAX_BYTES - 1) / MAX_BYTES
display_address aux
display_bytes aux
display CRLF
aux = aux + MAX_BYTES
end repeat
\\}
match =1, _ON_VIRTUAL\\{restore _LISTING\\}
match =equ, args\\{restore _LISTING\\}
match =equ any, args\\{restore _LISTING\\}
\}
}
macro data_reserve mnemonic
{
local aux
macro mnemonic [args]
\{
\common
match =1, _ON_VIRTUAL\\{_LISTING equ 0\\}
match =equ, args\\{_LISTING equ 0\\}
match =equ any, args\\{_LISTING equ 0\\}
match =1, _LISTING
\\{
display_address $
aux = $
\\}
mnemonic args
match =1, _LISTING
\\{
times MAX_BYTES display ' '
display \`mnemonic
display_args args
display CRLF
\\}
match =1, _ON_VIRTUAL\\{restore _LISTING\\}
match =equ, args\\{restore _LISTING\\}
match =equ any, args\\{restore _LISTING\\}
\}
struc mnemonic [args]
\{
\common
match =1, _ON_VIRTUAL\\{_LISTING equ 0\\}
match =equ, args\\{_LISTING equ 0\\}
match =equ any, args\\{_LISTING equ 0\\}
match =1, _LISTING
\\{
display_address $
aux = $
\\}
. mnemonic args
match =1, _LISTING
\\{
times MAX_BYTES display ' '
display \`., ' ', \`mnemonic
display_args args
display CRLF
\\}
match =1, _ON_VIRTUAL\\{restore _LISTING\\}
match =equ, args\\{restore _LISTING\\}
match =equ any, args\\{restore _LISTING\\}
\}
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;; LISTING CONTROL MACROSES ;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
macro virtual [args]
{
common
_ON_VIRTUAL equ 1
virtual args
}
macro end [args]
{
common
match =virtual, args\{restore _ON_VIRTUAL\}
end args
}
macro enable_listing
{
detect_mode
match =0, _MACROSES_INSTALLED
\{
match instructions, INSTRUCTIONS
\\{
irps ins, instructions
\\\{
instruction ins
\\\}
\\}
match prefixes, PREFIXES
\\{
irps prefix, prefixes
\\\{
def_prefix prefix
\\\}
\\}
match data_definitors, DATA_DEFINITORS
\\{
irps def, data_definitors
\\\{
data_define def
\\\}
\\}
match data_reservers, DATA_RESERVERS
\\{
irps def, data_reservers
\\\{
data_reserve def
\\\}
\\}
\}
_MACROSES_INSTALLED equ 1
_LISTING equ 1
}
macro disable_listing
{
_LISTING equ 0
}
macro enable [feature*]
{
forward
UNKNOWN equ 1
match =resolve_equates, feature
\{
restore _RESOLVE_EQUATES
_RESOLVE_EQUATES equ ON
UNKNOWN equ 0
\}
match =listing, feature
\{
enable_listing
UNKNOWN equ 0
\}
match =1, UNKNOWN
\{
display 'ERROR: Unknown "',`feature, '" feature', 13, 10
err
\}
restore UNKNOWN
restore UNKNOWN
}
macro disable [feature*]
{
UNKNOWN equ 1
match =resolve_equates, feature
\{
restore _RESOLVE_EQUATES
_RESOLVE_EQUATES equ OFF
UNKNOWN equ 0
\}
match =listing, feature
\{
disable_listing
UNKNOWN equ 0
\}
match =1, UNKNOWN
\{
display 'ERROR: Unknown "',`feature, '" feature', 13, 10
err
\}
restore UNKNOWN
restore UNKNOWN
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; INITIALIZATION ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
_MACROSES_INSTALLED equ 0
_ON_VIRTUAL equ 0
disable resolve_equates

View File

@ -1,4 +1,4 @@
; Copyright (c) 2009, <Lrz>
; Copyright (c) 2008-2009, <Lrz>
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
@ -12,7 +12,7 @@
; names of its contributors may be used to endorse or promote products
; derived from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY Alexey Teplov aka <Lrz> ''AS IS'' AND ANY
; THIS SOFTWARE IS PROVIDED BY Alexey Teplov nickname <Lrz> ''AS IS'' AND ANY
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
@ -25,103 +25,29 @@
;*****************************************************************************
;start of the project 13.02.2008 year.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Secondary Loader copyright Alexey Teplov aka <Lrz> & K Soft team
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Secondary Loader copyright Alexey Teplov nickname <Lrz>
;if you need log preproc
;/////////////
;include 'listing.inc'
;enable listing
;////////////
;;;;;;;;;;;;;;;;;;;;;;;;;;
;start of code:
;;;;;;;;;;;;;;;
DEBUG equ 1
root_dir_entry_count equ 224 ;êîë-âî ýëåìåíòîâ â êîðíåâîé äèððåêòîðèè
;point_to_fat_struc equ 0xA000 ;âðåìåííûé áóôåð, êóäà áóäåò ðàçìåùåíà Fat òàáëèöà, è çàòåì ïåðåíåñåíà çà 1 ìá
ini_data_ equ 0x2000 ;ôàéë ãäå ðàçìåùåí ôàéë ñöåíàðèÿ çàãðóçêè, òàì ïðîèñõîäèò ñèíòàêñè÷åñêèé ðàçáîð
size_show_section equ 18
default_timeout_value equ 5 ;default value to timeout is will was some errors
flag_found_default equ 0x1 ;default value is found
flag_found_timeout equ 0x2 ;timeout value is found
flag_found_LM equ 0x1 ;found LM value
flag_found_RS equ 0x2 ;found RS value
flag_found_GTRFMS equ 0x4 ;found type RamFS
flag_found_RamdiskSector equ 0x8 ;found RamdiskSector
flag_found_RamdiskCluster equ 0x16 ;found RamdiskCluster
;statick data ýòè äàííûå íå ïðåäîïðåäåëÿþòñÿ â òå÷åíèè âûïîëíåíèÿ âñåé ïðîãðàììû.
save_cx equ word [bp-2] ;save cx size ini file
ret_on_ch equ word [bp-4] ;point to return ðàçðóøàåìîå çíà÷åíèå
save_cx_d equ word [bp-6] ;save cx - size default section and working section
status_flag equ word [bp-8] ;status flag
point_loader equ word [bp-10]
point_default equ word [bp-12] ;point to default
;äàííûå êîòîðûå çàâèñèìû îò âåòêè âûïîëíåíèÿ è êîòîðûå ìîãóò áûòü ïåðåîïðåäåëåíû â ïðîöåññå âûïîëíåíèÿ ïðîãðàììû.
point_to_hframe equ word [bp-14] ;point on start frame (for change section)
point_to_1 equ word [bp-16]
point_to_2 equ word [bp-18]
point_to_3 equ word [bp-20]
point_to_4 equ word [bp-22]
point_to_5 equ word [bp-24]
point_to_6 equ word [bp-26]
point_to_7 equ word [bp-28]
point_to_8 equ word [bp-30]
point_to_9 equ word [bp-32]
point_to_10 equ word [bp-34]
point_to_11 equ word [bp-36]
point_to_12 equ word [bp-38]
point_to_13 equ word [bp-40]
point_to_14 equ word [bp-42]
point_to_15 equ word [bp-44]
point_to_16 equ word [bp-46]
point_to_16 equ word [bp-48]
point_to_17 equ word [bp-50]
point_to_18 equ word [bp-52]
;here array for fast scroling 16 word - poin to start section
point_to_point_def equ word [bp-54]
point_to_eframe equ word [bp-56] ;point on point frame
; òóò ðàñïîëîæåíî âðåìåííîå õðàíèëèùå äëÿ cx è di ïðè ïåðåõîäå íà ñëåäóþùèé áóôåð ïðè ïîèñêå ñåêöèé
find_sec_di equ word [bp-58] ;òóò áóäåò õðàíèòüñÿ di
info_real_mode_size equ word [bp-60];òóò õðàíèòüñÿ èíôîðìàöèÿ î çàíÿòîé îáëàñòè ò.å. ðàçìåð, ìîæíî óçíàòü ñêîëüêî îñòàëîñü ìåñòà âû÷èñëèâ
free_ad_memory equ word [bp-62] ;ñêîëüêî ó íàñ ðàñøèðåííîé ïàìÿòè äëÿ ôîðìèðîâàíèÿ ðàì äèñêà è çàãðóçêè ìîäóëåé
show_errors_sect equ word [bp-64] ;ïåðåìåíàÿ êîòîðàÿ õðàíèò áèòû îøèáîê äëÿ êàæäîé ëîãè÷åñêîé ñåêöèè.
save_descript_size equ word [bp-66] ;save descript size previos section ñîõðàíèì ðàçìåð ïðåäûäóùåé ñåêöèè êîòîðóþ âûâîäèëè
save_ramdisksize equ dword [bp-70] ;save size of ramdisk in byte
save_file_size equ dword [bp-74] ;save size of reading file
set_ramfs equ word [bp-76] ;îïðåäåëåííûé òèï ôàéëîâîé ñèñòåìû,íóæíî äëÿ ôîðìèðîâàíèÿ ðàì äèñêà
point_next_fat_str equ word [bp-78] ;óêàçàòåëü íà ñëåäóþùèé ýëåìåíò fat òàáëèöû
size_root_dir equ word [bp-80] ;êîë-âî ýëåìåíòîâ â ñåêòîðàõ ïî 512 áàéò êîðíåâîé äèðåêòîðèè
firstDataSect equ word [bp-82] ;ïåðâûé ñåêòîð äàííûõ â ñåòîðàõ îò 0
DataClasters equ word [bp-84] ;ðàçìåð ìàññèâà äîñòóïíîé äëÿ çàïèñè äàííûõ â êëàñòåðàõ.
point_to_free_root equ word [bp-86] ;óêàçàòåëü íà ñëåäóþùèé ïóñòóþ çàïèñü â ðóò äèð
point_to_dest_file_name equ word [bp-88] ;óêàçûâàåò íà íà÷àëî èìåíè ôàéëà íàçíà÷åíèÿ.
data_offset equ word [bp-90] ;ñìåùåíèå â êëàñòåðàõ äëÿ çàïèñàííûõ äàííûõ ò.å ïåðåêèíóòûõ çà 1-é ìá
first_input equ word [bp-92] ;ïîëå äëÿ ôëàãîâ â ïðåîáðàçîâàíèè èìåíè.
save_di_RAMDISK equ word [bp-94] ;ñîõðàíèì di -óêàçàòåëÿ ïðè îáðàáîòêå ñåêöèè
save_cx_RAMDISK equ word [bp-96] ;ñîõðàíèì ðàçìåð îñòàòêà ñåêöèè
status_flag_loader_f equ word [bp-98] ;ñîõðàíèì ðåçóëüòàò âûïîëåíåíèÿ çàãðóçêè ôàéëà
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;äàííûå êîòîðûå èñïîëüçóþòñÿ ïðè îáðàáîòêå ñåêöèè, ò.å. ïîñëå íàæàòèÿ Enter, óæå íå âîçìîæíî âåðíóòüñÿ â ïåðâîíà÷àëüíûé ýêðàí
;äëÿ âîçâðàòà, íåîáõîäèìî ïåðåçàïóñòèòü ïîëíîñòüþ êîä ò.å. ñòàðòîâàòü ñ 0õ1000:0000
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;start of code: ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use16
org 0x0
jmp start
include 'sl_equ.inc' ; â ôàéëå ðàçìåùåíû âñå equ ïðåäîïðåäåëåíèÿ
include 'boot_st.inc'
include 'debug_msg.inc' ;here is message from debug
include 'debug_msg.inc' ;here is message from debug
include 'parse_dat.inc'
include 'sl_proc.inc'
include 'parse.inc'
include 'parse_loader.inc'
include 'parse_any.inc'
include 'parse_def_sect.inc'
include 'parse_err.inc'
include 'parse_err.inc'
file_data dw 0x0,ini_data_ ;ôîðìàò: ñìåùåíèå: ñåãìåíò ò.ê. èñïîëüçóåòñÿ les
size_data dw 16 ;16 áëîêîâ ïî 4 êá ò.å ïðåäåë äî 64 êá
@ -158,13 +84,25 @@ start:
mov si,version
call printplain
mov al,'#'
mov cx,80
mov al,'#'
mov cx,80
;input cx=size al=char áóäåò âûâäåí ñèìâîë ñêîëüêî ðàç óêàçàíî â cx
@@:
call putchar
loop @b
call putchar
loop @b
if DEBUG
pushad
mov ax,cs
shl eax,4 ; â äåñÿòè÷íîé ñèñòåìå àäðåñ ñåãìåíòà
mov cx,0xa
mov di,cseg_msg
call decode
;***************
mov si,cseg_msg
call printplain
popad
end if
if DEBUG
@ -216,19 +154,64 @@ cpugood:
; set up esp
movzx esp, sp
;Load startos.ini
xor ax,ax ; function 1 - read file
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; init memory
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Load startos.ini
mov cx,loop_read_startos_file ;êîë-âî ïîïûòîê ÷òåíèÿ ôàéëà êîíôèãóðàöèè startos.ini
align 4
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Load startos.ini ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
load_startos_file:
xor ax,ax
mov di,file_data
inc ax
inc ax ;function 1 - read file
push cx
call far dword [loader_callback]
pop cx
push cs
push cs
push cs
pop ds
pop es
test bx,bx
jnz error_ini
jz check_conf_file
dec cx
jnz load_startos_file
;SET DEFAULT Not use ini file
error_ini:
mov si, error_ini_f1 ;Error: cannot load ini file, buffer is full
dec bx
jz err_show_ini
mov si, error_ini_f2 ;Error: ini file not found
dec bx
jz err_show_ini
mov si, error_ini_f3 ;Error: cannot read ini file
dec bx
jz err_show_ini
mov si, error_ini_nf ;Error: unrecognized error when loading ini file
err_show_ini:
call printplain
mov si, error_ini_common
call printplain
; wait for keypress
xor ax,ax
int 16h
ini_loaded:
jmp $
align 4
check_conf_file:
;Check config file in current dir
push ax ;save size file
if DEBUG
@ -250,46 +233,18 @@ use_parse ;parsing startos.ini
;
jmp ini_loaded
;SET DEFAULT Not use ini file
error_ini:
mov si, error_ini_f1 ;Error: cannot load ini file, buffer is full
dec bx
jz err_show_ini
mov si, error_ini_f2 ;Error: ini file not found
dec bx
jz err_show_ini
mov si, error_ini_f3 ;Error: cannot read ini file
dec bx
jz err_show_ini
mov si, error_ini_nf ;Error: unrecognized error when loading ini file
err_show_ini:
call printplain
mov si, error_ini_common
call printplain
; wait for keypress
mov ah, 0
int 16h
ini_loaded:
jmp $
;;;;;;;;;;;;;;;;;;;;;;;;;;;
;DATA
;;;;;;;;;;;;;;;;;;;;;;;;;;;
; table for move to extended memory (int 15h, ah=87h)
align 8
align 4
table_15_87:
db 0x00,0x00,0x0,0x00,0x00,0x00,0x0,0x0
db 0x00,0x00,0x0,0x00,0x00,0x00,0x0,0x0
db 0xff,0xff
db 0x0,0x10
db 0x00,0x93,0x0,0x0
db 0x0,0x10
db 0x00,0x93,0x0,0x0
db 0xff,0xff,0x0,0x00,0x10,0x93,0x0,0x0
@ -299,26 +254,26 @@ table_15_87:
db 0x00,0x00,0x0,0x00,0x00,0x00,0x0,0x0
fat12_buffer:
.BS_jmpBoot db 0x90,0x90,0x90 ;3 áàéòà NOP èíñòðóêöèÿ - íè÷åãî íå äåëàòü
.BS_OEMName db 'K SyS 64' ;8 áàéò
.BPB_BytsPerSec dw 512 ;êîë-âî áàéòîâ â ñåêòîðå ìîæåò áûòü ëþáîå 512 1024 2048 4096 2 áàéòà
.BPB_SecPerClus db 0x1 ;êîë-âî ñåêòîðîâ â êëàñòåðå
.BPB_RsvdSecCnt dw 0x1 ;äëÿ FAt12/16 òîëüêî 1, äëÿ FAT32 îáû÷íî 32
.BPB_NumFATs db 0x1 ;êîë-âî ôàò òàáëèö, íà òîò ñëó÷àé åñëè áóäåò ñáðîñ íà äèñêåòó îáðàçà ðàì äèñêà
.BPB_RootEntCnt dw 512 ;äëÿ ìàê ñîâìåñòèìîñòè ñ fat16
.BPB_TotSec16 dw 0x0 ;êë-âî ñåêòîðîâ
.BPB_Media db 0xF0
.BPB_FATSz16 dw 0x0
.BPB_SecPerTrk dw 0x0 ;ñîäåðæèò ãåîìåòðèþ äèñêà äëÿ RAMFS íà êàê áû áåç ðàçíèöû, ïîêà ïóñòîå ïîëå, ïîçæå âíåñòè ðåàëüíûå çíà÷åíèÿ.
.BPB_NumHeads dw 0x0
.BPB_HiddSec dd 0x0 ;êîë-âî ñêðûòûõ ñåêòîðîâ
.BPB_TotSec32 dd 0x0
.BS_DrvNum db 'R' ;îò ñëîâà RAM
.BS_Reserved1 db 0x0
.BS_BootSig db 0x29
.BS_VolID db 'RFKS'
.BS_VolLab db 'RAM DISK FS' ;11 ñèìâîëîâ
.BS_FilSysType db 'FAT12 ' ;8 ñèìâîëîâ
.BS_jmpBoot db 0x90,0x90,0x90 ;3 áàéòà NOP èíñòðóêöèÿ - íè÷åãî íå äåëàòü
.BS_OEMName db 'K SyS 64' ;8 áàéò
.BPB_BytsPerSec dw 512 ;êîë-âî áàéòîâ â ñåêòîðå ìîæåò áûòü ëþáîå 512 1024 2048 4096 2 áàéòà
.BPB_SecPerClus db 0x1 ;êîë-âî ñåêòîðîâ â êëàñòåðå
.BPB_RsvdSecCnt dw 0x1 ;äëÿ FAt12/16 òîëüêî 1, äëÿ FAT32 îáû÷íî 32
.BPB_NumFATs db 0x1 ;êîë-âî ôàò òàáëèö, íà òîò ñëó÷àé åñëè áóäåò ñáðîñ íà äèñêåòó îáðàçà ðàì äèñêà
.BPB_RootEntCnt dw 512 ;äëÿ ìàê ñîâìåñòèìîñòè ñ fat16
.BPB_TotSec16 dw 0x0 ;êë-âî ñåêòîðîâ
.BPB_Media db 0xF0
.BPB_FATSz16 dw 0x0
.BPB_SecPerTrk dw 0x0 ;ñîäåðæèò ãåîìåòðèþ äèñêà äëÿ RAMFS íà êàê áû áåç ðàçíèöû, ïîêà ïóñòîå ïîëå, ïîçæå âíåñòè ðåàëüíûå çíà÷åíèÿ.
.BPB_NumHeads dw 0x0
.BPB_HiddSec dd 0x0 ;êîë-âî ñêðûòûõ ñåêòîðîâ
.BPB_TotSec32 dd 0x0
.BS_DrvNum db 'R' ;îò ñëîâà RAM
.BS_Reserved1 db 0x0
.BS_BootSig db 0x29
.BS_VolID db 'RFKS'
.BS_VolLab db 'RAM DISK FS' ;11 ñèìâîëîâ
.BS_FilSysType db 'FAT12 ' ;8 ñèìâîëîâ
;62 áàéòà ñòðóêòóðà fat12.
@ -327,33 +282,33 @@ fat12_buffer:
;ñòðóêòóðà äëÿ äèððåêòîðèè fat
struc FAT_32_entry ;Byte Directory Entry Structure
{
.DIR_Name rb 11
.DIR_Attr db ?
.DIR_NTRes db ?
.DIR_CrtTimeTenth db ?
.DIR_CrtTime dw ?
.DIR_CrtDate dw ?
.DIR_LstAccDate dw ?
.DIR_FstClusHI dw ?
.DIR_WrtTime dw ?
.DIR_WrtDate dw ?
.DIR_FstClusLO dw ?
.DIR_FileSize dd ?
.DIR_Name rb 11
.DIR_Attr db ?
.DIR_NTRes db ?
.DIR_CrtTimeTenth db ?
.DIR_CrtTime dw ?
.DIR_CrtDate dw ?
.DIR_LstAccDate dw ?
.DIR_FstClusHI dw ?
.DIR_WrtTime dw ?
.DIR_WrtDate dw ?
.DIR_FstClusLO dw ?
.DIR_FileSize dd ?
}
;Òóò áóäóò ðàñïîëîãàòñüÿ äàííûå, êîòîðûå çàòðóäíèòåëüíî ðàñïîëîãàòü â ñòåêîâîé îáëàñòè....
;;;
;timer
shot_name_fat rb 11
shot_name_fat rb 11 ;âðåìåííûé áóôåð äëÿ fat12, â íåì õðàíÿòüñÿ èìåíà ôàéëîâ ïðèâåäåííûå ê ïðàâèëàì FAT /* âäàëüíåéøåì ïåðåíåñòè â ñòýê
if DEBUG
rb 1 ;íóæåí äëÿ îòëàäêè è âûâîäà èìåíè ôàéëà ïîñëå ïðåîáðàçîâàíèÿ
dest_name_fat rb 12
rb 1 ;íóæåí äëÿ îòëàäêè è âûâîäà èìåíè ôàéëà ïîñëå ïðåîáðàçîâàíèÿ
dest_name_fat rb 12
end if
value_timeout rw 1 ;value to timeout
old_timer rd 1 ;ñòàðîå çíà÷åíèå âåêòîðà òàéìåðà
start_timer rd 1 ;çíà÷åíèå òàéìåðà
timer_ rd 1 ;íîâîå çíà÷åíèå âåêòîðà òàéìåðà ò.å. SL
start_stack rw 1 ;save stack
save_bp_from_timer rw 1 ;save bp from timer
value_timeout rw 1 ;value to timeout
old_timer rd 1 ;ñòàðîå çíà÷åíèå âåêòîðà òàéìåðà
start_timer rd 1 ;çíà÷åíèå òàéìåðà
timer_ rd 1 ;íîâîå çíà÷åíèå âåêòîðà òàéìåðà ò.å. SL
start_stack rw 1 ;save stack
save_bp_from_timer rw 1 ;save bp from timer

View File

@ -12,7 +12,7 @@
; names of its contributors may be used to endorse or promote products
; derived from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY Alexey Teplov aka <Lrz> ''AS IS'' AND ANY
; THIS SOFTWARE IS PROVIDED BY Alexey Teplov nickname <Lrz> ''AS IS'' AND ANY
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
@ -36,47 +36,47 @@ macro use_parse
parse_start:
;es:di as 2000:0000 new segment
;óñòàíîâèì óêàçàòåëü íà çàãðóæåííûé áëîê
enter 256,0 ;set 16 byte for current task in stack
enter 256,0 ;set 16 byte for current task in stack
;we are is not use bp because bp is pointer on array 16 byte
mov word [save_bp_from_timer],bp ;save point to own data array
mov save_cx,cx ;it's placed size of ini file
mov word [save_bp_from_timer],bp ;save point to own data array
mov save_cx,cx ;it's placed size of ini file
les di,dword [file_data]
;îáíóëèì âñå ïåðåìåííûå âûäåëåííûå èç ñòåêà
;init flag
xor ax,ax
mov status_flag,ax
xor ax,ax
mov status_flag,ax
;set data size
mov info_real_mode_size,ini_data_ +0x1000 ;èçìåíèì çíà÷åíèå çàíÿòîñòè ïàìÿòè
mov info_real_mode_size,ini_data_ +0x1000 ;èçìåíèì çíà÷åíèå çàíÿòîñòè ïàìÿòè
;ïîèñê íà÷àëà áëîêà.
;///////////check [loader]
cld
mov ret_on_ch,.start ;set return
mov al,byte [es:di]
push word .first_ret
cmp al,' '
jz .first_sp_1
jmp get_firs_sym.not_space
mov ret_on_ch,.start ;set return
mov al,byte [es:di]
push word .first_ret
cmp al,' '
jz .first_sp_1
jmp get_firs_sym.not_space
.first_sp_1:
jmp get_firs_sym.first_sp
jmp get_firs_sym.first_sp
.start:
call get_firs_sym ;get first symbol on new line
call get_firs_sym ;get first symbol on new line
.first_ret: ;ïåðâûé âîçâðàò
; jcxz .end_file ;.end_loader ;found or not found parametrs in section exit in section
test cx,cx
jz error.not_loader
cmp al,'['
jz .parse_loader
jmp .start
; jcxz .end_file ;.end_loader ;found or not found parametrs in section exit in section
test cx,cx
jz error.not_loader
cmp al,'['
jz .parse_loader
jmp .start
;////// ïðîâåðêà íà íàëè÷åå ñåêöèè loader
use_parse_loader
;pause
if DEBUG
xor ax,ax
xor ax,ax
int 16h
end if
end if
;////// âûâîä ãðàôè÷åñêîãî ýêðàíà, âûáîð, ñåêöèè ïîä äåôîëòó
use_any_sec
;ïàðñèíã âûáðàíîé èëè äåôîëòíîé ñåêöèè ò.å. ðàçáîð ïàðàìåòðîâ âûïîëíåíèå ñöåíàðèÿ

View File

@ -25,18 +25,18 @@
;*****************************************************************************
;òóò ðàñïîëîãàåòñÿ ìîäóëü ñ ïîìîùüþ êîòîðîãî áóäóò ïàðñèòüñÿ âñå îñòàëüíûå ñåêöèè
color_sym_black equ 0
color_sym_blue equ 1
color_sym_green equ 2
color_sym_black equ 0
color_sym_blue equ 1
color_sym_green equ 2
color_sym_turquoise equ 3
color_sym_red equ 4
color_sym_red equ 4
color_sym_lightgray equ 7
color_sym_lightblue equ 9
color_sym_lightblue equ 9
color_sym_lettuce equ 10
color_sym_pink equ 12
color_sym_yellow equ 14
color_sym_pink equ 12
color_sym_yellow equ 14
macro use_any_sec
{
@ -45,12 +45,12 @@ macro use_any_sec
if DEBUG
pusha
mov ax,word [value_timeout] ;èäåò ïðîâåðêà íà íàëè÷åå çíà÷åíèÿ timeout, äëÿ áîëåå áûñòðîé ðàáîòû, ýòîò ïàðàìåòð äîëæåí áûòü óæå îáðàáîòàí,ò.å. â ýòîì ñëó÷àå ïðè åãî =0 áóäåò ñôîðìèðîâàí óêàçàòåëü òîëüêî íà äåôîëòíóþ ñåêöèþ, èíà÷å èíôîðìàöèÿ áóäåò ñîáðàíà ïî âñåì ñåêöèÿì è ñîñòàâëåíû óêàçàòåëè â áëîêå ïàìÿòè
mov ax,word [value_timeout] ;èäåò ïðîâåðêà íà íàëè÷åå çíà÷åíèÿ timeout, äëÿ áîëåå áûñòðîé ðàáîòû, ýòîò ïàðàìåòð äîëæåí áûòü óæå îáðàáîòàí,ò.å. â ýòîì ñëó÷àå ïðè åãî =0 áóäåò ñôîðìèðîâàí óêàçàòåëü òîëüêî íà äåôîëòíóþ ñåêöèþ, èíà÷å èíôîðìàöèÿ áóäåò ñîáðàíà ïî âñåì ñåêöèÿì è ñîñòàâëåíû óêàçàòåëè â áëîêå ïàìÿòè
; mov ax,cx
mov cx,0x0a
mov di,show_db1
mov dword[ds:di],' '
mov word [ds:di+4],' '
mov word [ds:di+4],' '
call decode
;Show size
mov si,show_db1
@ -59,15 +59,15 @@ if DEBUG
popa
end if
test ax,ax
jz .parse_run_only
test ax,ax
jz .parse_run_only
;îòîáðàçèì ïîëíûé ñïèñîê âñåõ íàéäåíûõ ñåêöèé.
if DEBUG
pusha
mov si,show_all_sect
call printplain
popa
pusha
mov si,show_all_sect
call printplain
popa
end if
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
mov al, 0xf6 ; Ñáðîñ êëàâèàòóðû, ðàçðåøèòü ñêàíèðîâàíèå
@ -115,141 +115,141 @@ end if
;ïðîöåäóðà ôîðìèðîâàíèÿ áóôåðà äëÿ ñêðîëèíãà ñåêöèé
;if DEBUG
; pusha
; mov ax,point_default
; mov ax,point_default
; mov ax,cx
; mov cx,0x0a
; mov di,show_db1
; mov dword[ds:di],' '
; mov word [ds:di+4],' '
; mov word [ds:di+4],' '
; call decode
;Show size
; mov si,show_db1
; call printplain
;
; xor ax,ax
; int 0x16
; xor ax,ax
; int 0x16
; popa
;end if
;;;;;;;;;;;;;ðàçìåð ïðåäûäóùåé ñåöèè óñòàíîâèì =0
mov save_descript_size,18
mov save_descript_size,18
;îòîáðàçèòü black screen
show_bl_sc ;es=0xb800
show_bl_sc ;es=0xb800
.show_all_scr:
get_frame_buffer ;es=0x2000
;îòîáðàæåíèå ñåêöèé
call show_bl_sc_sect ;es=0xb800
call show_bl_sc_sect ;es=0xb800
;îòîáðàçèòü àêòèâíûé êóðñîð
.show_active_cursor:
show_act_cursor
show_descript ;ìàêðîñ ïî îòîáðàæåíèþ îïèñàíèÿ ñåêöèè
show_descript ;ìàêðîñ ïî îòîáðàæåíèþ îïèñàíèÿ ñåêöèè
;îòîáðàçèòü Press any key ....
mov eax,dword [old_timer]
cmp eax,dword [timer_]
jz .interrupt_16
mov eax,dword [old_timer]
cmp eax,dword [timer_]
jz .interrupt_16
show_timer_message
mov word [start_stack],sp
mov word [start_stack],sp
.interrupt_16:
xor ax,ax ;ïîëó÷èì èíôîðìàöèþ î òîì ÷òî íàæàòî
int 0x16
xor ax,ax ;ïîëó÷èì èíôîðìàöèþ î òîì ÷òî íàæàòî
int 0x16
;check on change
mov ebx,dword [old_timer]
cmp ebx,dword [timer_]
jz @f
mov ebx,dword [old_timer]
cmp ebx,dword [timer_]
jz @f
;restore timer interrupt
cli
cli
push 0
pop es
; mov eax,dword [old_timer] ; âîññòàíîâèì ïðåæäíåå ïðåðûâàíèå
mov [es:8*4],ebx
mov dword [timer_],ebx
sti
push ax
sti
push ax
clear_timer_msg
pop ax
pop ax
@@:
call clean_active_cursor ;clean old cursor ;es=0xb800
call clean_active_cursor ;clean old cursor ;es=0xb800
cmp ah,0x48 ;ðåàêöèÿ ñèñòåìû íà ñîáûòèÿ
jz .up
cmp ah,0x50
jz .down
cmp ah,0x49
jz .pgup
cmp ah,0x51
jz .pgdown
cmp ah,0x47
jz .home
cmp ah,0x4f
jz .end
cmp ah,0x48 ;ðåàêöèÿ ñèñòåìû íà ñîáûòèÿ
jz .up
cmp ah,0x50
jz .down
cmp ah,0x49
jz .pgup
cmp ah,0x51
jz .pgdown
cmp ah,0x47
jz .home
cmp ah,0x4f
jz .end
cmp al,0xD
jnz .show_active_cursor
cmp al,0xD
jnz .show_active_cursor
jmp .end_show_all ;ïàðñèíã ñåêöèè êîòîðàÿ óêàçàíà â point_default
jmp .end_show_all ;ïàðñèíã ñåêöèè êîòîðàÿ óêàçàíà â point_default
.up:
mov si,point_to_point_def ;çíà÷åíèå óêàçàòåëÿ
add si,2
lea ax,point_to_hframe
mov si,point_to_point_def ;çíà÷åíèå óêàçàòåëÿ
add si,2
lea ax,point_to_hframe
cmp si,ax
ja @f
cmp si,ax
ja @f
mov point_to_point_def,si
mov ax,[si]
mov point_default,ax
jmp .show_active_cursor
mov point_to_point_def,si
mov ax,[si]
mov point_default,ax
jmp .show_active_cursor
@@:
call find_before_sect
jmp .show_all_scr
call find_before_sect
jmp .show_all_scr
.down:
mov si,point_to_point_def ;çíà÷åíèå óêàçàòåëÿ
mov ax,point_to_eframe ;óêàçàòåëü íà ïîñëåäíèé ýëåìåíò
sub si,2
cmp si,ax
jb @f
mov si,point_to_point_def ;çíà÷åíèå óêàçàòåëÿ
mov ax,point_to_eframe ;óêàçàòåëü íà ïîñëåäíèé ýëåìåíò
sub si,2
cmp si,ax
jb @f
mov point_to_point_def,si
mov ax,[si]
mov point_default,ax
jmp .show_active_cursor
mov point_to_point_def,si
mov ax,[si]
mov point_default,ax
jmp .show_active_cursor
@@: call find_next_sect
jmp .show_all_scr
@@: call find_next_sect
jmp .show_all_scr
.pgup:
mov cx,size_show_section
mov cx,size_show_section
@@:
push cx
call find_before_sect
pop cx
loop @b
jmp .show_all_scr
push cx
call find_before_sect
pop cx
loop @b
jmp .show_all_scr
.pgdown:
mov cx,size_show_section
mov cx,size_show_section
@@:
push cx
call find_next_sect
pop cx
loop @b
jmp .show_all_scr
push cx
call find_next_sect
pop cx
loop @b
jmp .show_all_scr
.home:
xor di,di
call find_next_sect.h
jmp .show_all_scr
xor di,di
call find_next_sect.h
jmp .show_all_scr
.end:
mov di,save_cx
call find_before_sect.e
jmp .show_all_scr
mov di,save_cx
call find_before_sect.e
jmp .show_all_scr
@ -257,10 +257,10 @@ clear_timer_msg
; òóò ìû áóäåì ïàðñèòü òîëüêî äåôîëòíóþ ñåêöèþ è âûïîëíÿòü åå íè÷åãî íå ïðåäëàãàÿ ïîëüçîâàòåëþ èç äèàëîãîâ.
.parse_run_only:
if DEBUG
pusha
mov si,no_show_only_w
call printplain
popa
pusha
mov si,no_show_only_w
call printplain
popa
end if
@ -287,63 +287,63 @@ macro show_bl_sc
;;;;;;;;;;;;;;;
;î÷èñòèì ýêðàí è âûâåäåì ìåíþ
; draw frames
xor ax,ax
xor ax,ax
if DEBUG
mov ax,0x0720
mov ax,0x0720
end if
push 0xb800
pop es
xor di, di
; draw top
mov cx, 25 * 80
rep stosw
rep stosw
;;;;;;;;;;;;;;;;;;;;;;; show 'Secondary Loader v0.xxx'
mov di,164
mov si,version
mov cx,version_end-version
mov ah,color_sym_yellow
mov di,164
mov si,version
mov cx,version_end-version
mov ah,color_sym_yellow
@@:
lodsb
stosw
loop @b
lodsb
stosw
loop @b
;;;;;;;;;;;;;;;;;;;;;;; show firm ))
mov di,286
mov ah,color_sym_pink;color_sym_red
mov al,'K'
stosw
mov al,' '
stosw
mov ah,color_sym_lightgray;color_sym_lightblue;color_sym_pink
mov si,soft_mes
mov cx,soft_mes_end- soft_mes
mov di,(2*160-(2*(soft_mes_end-soft_mes+4))) ;286
mov ah,color_sym_pink;color_sym_red
mov al,'K'
stosw
mov al,' '
stosw
mov ah,color_sym_lightgray;color_sym_lightblue;color_sym_pink
mov si,soft_mes
mov cx,soft_mes_end- soft_mes
@@:
lodsb
stosw
loop @b
lodsb
stosw
loop @b
;;;;;;;;;;;;;;;;;;;;;;; show '__________________________'
mov di,480
mov ah,color_sym_yellow
mov al,'Ä'
mov cx,61
rep stosw
mov di,480
mov ah,color_sym_yellow
mov al,'Ä'
mov cx,61
rep stosw
;;;;;;;;;;;;;;;;;;;;;;; show 'Select section'
mov di,804
mov si,select_section
mov cx,select_section_end - select_section
mov ah,color_sym_lightgray
mov di,804
mov si,select_section
mov cx,select_section_end - select_section
mov ah,color_sym_lightgray
@@:
lodsb
stosw
loop @b
lodsb
stosw
loop @b
;;;;;;;;;;;;;;;;;;;;;;; show 'Section description'
mov di,880
mov si,section_description
mov cx,section_description_end - section_description
; mov ah,color_sym_lightgray
mov di,880
mov si,section_description
mov cx,section_description_end - section_description
; mov ah,color_sym_lightgray
@@:
lodsb
stosw
loop @b
lodsb
stosw
loop @b
}
@ -352,54 +352,54 @@ macro show_timer_message
;;;;;;;;;;;;;;;;;;;;; show Press any key
;;;;;;;;;;;;;;;;;;;;; show ramk
xor ax,ax
mov di,3360
mov cx,80*4
rep stosw
xor ax,ax
mov di,3360
mov cx,80*4
rep stosw
mov di,3362
mov ah,color_sym_pink
mov al,0xDA
stosw
mov al,0xc4
mov cx,76
rep stosw
mov al,0xBF
stosw
add di,4
mov al,0xb3
stosw
add di,152
stosw
add di,4
stosw
add di,152
stosw
add di,4
mov al,0xc0
stosw
mov al,0xc4
mov cx,76
rep stosw
mov al,0xd9
stosw
mov al,0xDA
stosw
mov al,0xc4
mov cx,76
rep stosw
mov al,0xBF
stosw
add di,4
mov al,0xb3
stosw
add di,152
stosw
add di,4
stosw
add di,152
stosw
add di,4
mov al,0xc0
stosw
mov al,0xc4
mov cx,76
rep stosw
mov al,0xd9
stosw
;;;;;;;;;;;;;;;;;;;;;;;;ramk is complete show
;show first message
mov si,start_msg
mov cx,start_msg_e-start_msg
mov di,3526
mov si,start_msg
mov cx,start_msg_e-start_msg
mov di,3526
@@:
lodsb
stosw
loop @b
lodsb
stosw
loop @b
;;;;;;;;;;;;;;;;;;;; show press Enter to....
add di,44
mov si,time_msg
mov cx,time_msg_e-time_msg
add di,44
mov si,time_msg
mov cx,time_msg_e-time_msg
@@:
lodsb
stosw
loop @b
lodsb
stosw
loop @b
}
@ -411,144 +411,144 @@ macro show_timer_message
macro get_frame_buffer
{
mov cx,save_cx ;it's placed size of ini file
mov cx,save_cx ;it's placed size of ini file
les di,dword [file_data]
mov si,di ;point frame
mov bx,cx
mov dx,size_show_section
; mov point_to_hframe,di ; âíåñåì çíà÷åíèå, òàê ïîäñòðàõîâêà íå áîëåå
mov si,di ;point frame
mov bx,cx
mov dx,size_show_section
; mov point_to_hframe,di ; âíåñåì çíà÷åíèå, òàê ïîäñòðàõîâêà íå áîëåå
mov al,byte [es:di]
push word .first_ret_bl_sc
cmp al,' '
jz .first_bl_sc
jmp get_firs_sym.not_space
mov al,byte [es:di]
push word .first_ret_bl_sc
cmp al,' '
jz .first_bl_sc
jmp get_firs_sym.not_space
.first_bl_sc:
jmp get_firs_sym.first_sp
jmp get_firs_sym.first_sp
.start_hbl:
call get_firs_sym ;get first symbol on new line
test cx,cx
jz error.correct_exit_bl ;critical error not found default point it's not possible because it's param chacking before
cmp al,'['
jnz .start_hbl
call get_firs_sym ;get first symbol on new line
test cx,cx
jz error.correct_exit_bl ;critical error not found default point it's not possible because it's param chacking before
cmp al,'['
jnz .start_hbl
mov si,di ;point frame
mov bx,cx
mov dx,size_show_section
jmp .analisist_al
mov si,di ;point frame
mov bx,cx
mov dx,size_show_section
jmp .analisist_al
.start_bl:
call get_firs_sym ;get first symbol on new line
call get_firs_sym ;get first symbol on new line
.first_ret_bl_sc: ;ïåðâûé âîçâðàò
test cx,cx
jz error.correct_exit_bl ;critical error not found default point it's not possible because it's param chacking before
test cx,cx
jz error.correct_exit_bl ;critical error not found default point it's not possible because it's param chacking before
.analisist_al:
cmp al,'['
jnz .start_bl
cmp al,'['
jnz .start_bl
;ïðîñìàòðèâàåì ini ôàéë ñ íà÷àëà â ïîèñêàõ ñåêöèè óêàçàíîé êàê default
;ïîèñê ôðåéìà â êîòîðîì ñîäåðæèòüñÿ çíà÷åíèå default
.found_sect_bl:
cmp di,point_loader
jz .start_bl
cmp di,point_default
jz .save_point_def
cmp di,point_loader
jz .start_bl
cmp di,point_default
jz .save_point_def
dec dx
jnz .start_bl
dec dx
jnz .start_bl
jmp .start_hbl
jmp .start_hbl
.save_point_def:
;èòàê äàëåå ìû äîëæíû çàïîëíèòü frame áóôåð àäðåñîâ ñåêöèé, ÷òî áû ïîòîì ïî íåìó áûñòðî ïåðåìåùàòüñÿ íå âû÷èñëÿÿ ñíîâà àäðåñà
mov di,si ;óêàçàòåëü íà íà÷àëî
mov cx,bx
lea si,point_to_hframe
mov dx,size_show_section+1 ;ò.ê. ó íàñ ñòðóêòóðà ñîäåðæèò ðàçìåð ìåæäó ïåðâûì è âòîðûì óêàçàòåëåì, òî íàì íóæíî íà 1 àäðåñ áîëüøå îáñ÷èòàòü ñåêöèé.
mov di,si ;óêàçàòåëü íà íà÷àëî
mov cx,bx
lea si,point_to_hframe
mov dx,size_show_section+1 ;ò.ê. ó íàñ ñòðóêòóðà ñîäåðæèò ðàçìåð ìåæäó ïåðâûì è âòîðûì óêàçàòåëåì, òî íàì íóæíî íà 1 àäðåñ áîëüøå îáñ÷èòàòü ñåêöèé.
;ïåðåõîäèì íà îáðàáîòêó çíà÷åíèÿ óêàçàòåëÿ
mov al,byte [es:di]
push word .first_ret_mfb
cmp al,' '
jz .first_bl_mbf
jmp get_firs_sym.not_space
mov al,byte [es:di]
push word .first_ret_mfb
cmp al,' '
jz .first_bl_mbf
jmp get_firs_sym.not_space
.first_bl_mbf:
jmp get_firs_sym.first_sp
jmp get_firs_sym.first_sp
.start_mfb:
call get_firs_sym ;get first symbol on new line
call get_firs_sym ;get first symbol on new line
.first_ret_mfb: ;ïåðâûé âîçâðàò
jcxz .val_buff_comp ;.end_loader ;found or not found parametrs in section exit in section
cmp al,'['
jnz .start_mfb
jcxz .val_buff_comp ;.end_loader ;found or not found parametrs in section exit in section
cmp al,'['
jnz .start_mfb
.found_sect_mfb:
cmp di,point_loader ;if we have section loader
jz .start_mfb
cmp di,point_loader ;if we have section loader
jz .start_mfb
mov [si],di
mov [si],di
sub si,2
dec dx
jnz .start_mfb
sub si,2
dec dx
jnz .start_mfb
;bufer is full
jmp @f
jmp @f
.val_buff_comp:
push save_cx
pop word [si]
sub si,2
push save_cx
pop word [si]
sub si,2
@@:
add si,4
mov point_to_eframe,si
add si,4
mov point_to_eframe,si
}
macro show_act_cursor
{
;îòîáðàæåíèå êóðñîðà ïî óìîë÷àíèþ
lea si,point_to_hframe
mov di,962-160
mov ax,point_default
mov cx,size_show_section
lea si,point_to_hframe
mov di,962-160
mov ax,point_default
mov cx,size_show_section
.home_show_cur:
mov bx,[si]
add di,160
cmp bx,ax
jz .show_cursor_activ
sub si,2
loop .home_show_cur
mov bx,[si]
add di,160
cmp bx,ax
jz .show_cursor_activ
sub si,2
loop .home_show_cur
.show_cursor_activ:
; push 0xb800
; pop es
mov point_to_point_def,si
mov ax,(color_sym_red*0x100+0x10)
stosw
add di,68
inc ax
stosw
; push 0xb800
; pop es
mov point_to_point_def,si
mov ax,(color_sym_red*0x100+0x10)
stosw
add di,68
inc ax
stosw
}
macro clear_timer_msg
{
push 0xb800
pop es
xor ax,ax
push 0xb800
pop es
xor ax,ax
if DEBUG
mov ax,0x0720
mov ax,0x0720
end if
;;;;;;;;;;;;;;;;;;;;; show Press any key
mov di,3360
mov cx,80*4
rep stosw
mov di,3360
mov cx,80*4
rep stosw
;show sect
push ini_data_
pop es
call show_bl_sc_sect ;es=0xb800
push ini_data_
pop es
call show_bl_sc_sect ;es=0xb800
}
@ -562,21 +562,21 @@ local .rest_value_loop_sh_d
local .end_sh_desc_sec
local .loop_message
local .show_mess_prev_eq
mov di,point_default
push ini_data_
mov si,point_to_point_def
pop es
sub si,2
mov cx,[si] ;çàãðóçèì óêàçàòåëü íàñëåäóþùèþ ñåêöèþ
sub cx,di ;âîò òåïåðü èìååì èñòèíûé ðàçìåð
mov di,point_default
push ini_data_
mov si,point_to_point_def
pop es
sub si,2
mov cx,[si] ;çàãðóçèì óêàçàòåëü íàñëåäóþùèþ ñåêöèþ
sub cx,di ;âîò òåïåðü èìååì èñòèíûé ðàçìåð
;di - óêàçàòåëü íà äåôîëòíóþ ñåêöèþ ò.å. âûáðàííóþ cx - ðàçìåð îáëàñòè. äëÿ ïðîñìîòðà
.start_p_sh_d:
call get_firs_sym ;get first symbol on new line
test cx,cx
jz .exit ;íåòó? íó ëàäíî - ñëåäóþùåå çíà÷åíèå òîãäà )
cmp al,'d'
jnz .start_p_sh_d
call get_firs_sym ;get first symbol on new line
test cx,cx
jz .exit ;íåòó? íó ëàäíî - ñëåäóþùåå çíà÷åíèå òîãäà )
cmp al,'d'
jnz .start_p_sh_d
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
mov bx,cx
@ -585,99 +585,99 @@ local .show_mess_prev_eq
mov si,parse_descript
mov cx,parse_descript_e - parse_descript
repe cmpsb
jnz .rest_value_loop_sh_d ;is not compare
jnz .rest_value_loop_sh_d ;is not compare
sub bx,parse_descript_e - parse_descript ;correct cx
add bx,cx
mov cx,bx
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ðàçáîð àëÿ ' = '
mov ax,0x3d20 ;cut al=' ' ah='='
repe scasb
jcxz .rest_value_loop_sh_d ;not found param timeout
mov ax,0x3d20 ;cut al=' ' ah='='
repe scasb
jcxz .rest_value_loop_sh_d ;not found param timeout
cmp ah,byte [es:di-1] ;find '='
jnz .rest_value_loop_sh_d
repe scasb ;cut ' '
inc cx
dec di
cmp ah,byte [es:di-1] ;find '='
jnz .rest_value_loop_sh_d
repe scasb ;cut ' '
inc cx
dec di
;;;;;;;;;;;;;;;;;;;;di óêàçûâàåò íà ñòðî÷êó, êîòîðóþ íàì íóæíî âûâîäèòü.
;ñòðî÷êà áóäåò âûâîäèòüñÿ áëîêàìè ïî 37 ñèìâîëîâ.
;íàñòðîèì êóäà áóäåì âûâîäèòü ò.å. íà÷àëî
;es:di - óêàçûâàþò íà ñòðî÷êó èç êîòîðîé ìû áåðåì ñèìâîë, ds:si êóäà áóäåì âûâîäèòü
push di
pop si
push di
pop si
push es
pop ds
push es
pop ds
push 0xb800
pop es
mov di,1040
mov bx,18
mov find_sec_di,di
mov save_cx_d,bx
;;;;;;;;;;;;;;;;;;;;;;;;;;
push 0xb800
pop es
mov di,1040
mov bx,18
mov find_sec_di,di
mov save_cx_d,bx
;;;;;;;;;;;;;;;;;;;;;;;;;;
;clean string
push di
xor ax,ax
push di
xor ax,ax
@@: mov cx,38
push di
rep stosw
pop di
@@: mov cx,38
push di
rep stosw
pop di
cmp save_descript_size,bx
jz @f
cmp save_descript_size,bx
jz @f
add di,160
dec bx
jnz @b
add di,160
dec bx
jnz @b
@@: pop di
@@: pop di
;enter in mess
.show_mess_prev_eq:
lodsb
mov ah,color_sym_lettuce;color_sym_turquoise
; sub di,2
cmp al,'"'
jz .loop_message
cmp al,"'"
jnz .end_sh_desc_sec
lodsb
mov ah,color_sym_lettuce;color_sym_turquoise
; sub di,2
cmp al,'"'
jz .loop_message
cmp al,"'"
jnz .end_sh_desc_sec
.loop_message:
mov cx,38
mov cx,38
@@:
lodsb
cmp al,'"'
jz .end_sh_desc_sec
cmp al,"'"
jz .end_sh_desc_sec
stosw
loop @b
add find_sec_di,160
mov di,find_sec_di
dec save_cx_d
cmp save_cx_d,0
jnz .loop_message
lodsb
cmp al,'"'
jz .end_sh_desc_sec
cmp al,"'"
jz .end_sh_desc_sec
stosw
loop @b
add find_sec_di,160
mov di,find_sec_di
dec save_cx_d
cmp save_cx_d,0
jnz .loop_message
.end_sh_desc_sec:
push save_cx_d
pop save_descript_size
push save_cx_d
pop save_descript_size
push cs
pop ds
jmp .exit
push cs
pop ds
jmp .exit
.rest_value_loop_sh_d:
mov di,ax
mov cx,bx
jmp .start_p_sh_d
mov di,ax
mov cx,bx
jmp .start_p_sh_d
.exit:
}

View File

@ -12,7 +12,7 @@
; names of its contributors may be used to endorse or promote products
; derived from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY Alexey Teplov aka <Lrz> ''AS IS'' AND ANY
; THIS SOFTWARE IS PROVIDED BY Alexey Teplov nickname <Lrz> ''AS IS'' AND ANY
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
@ -29,11 +29,11 @@ parse_loader db '[loader]'
parse_loader_e:
parse_l_timeout db 'timeout'
parse_l_timeout_e:
parse_l_default db 'default'
parse_l_default db 'default'
parse_l_default_e:
parse_name db 'ame'
parse_name db 'ame'
parse_name_e:
parse_descript db 'descript'
parse_descript db 'descript'
parse_descript_e:
parse_LoaderModule db 'LoaderModule'
@ -42,15 +42,15 @@ parse_RamdiskSize db 'RamdiskSize'
parse_RamdiskSize_e:
parse_RamdiskFS db 'RamdiskFS'
parse_RamdiskFS_e:
parse_RamdiskSector db 'RamdiskSector'
parse_RamdiskSector db 'RamdiskSector'
parse_RamdiskSector_e:
parse_RamdiskCluster db 'RamdiskCluster'
parse_RamdiskCluster db 'RamdiskCluster'
parse_RamdiskCluster_e:
parse_RFS_FAT db 'FAT'
parse_RFS_FAT db 'FAT'
parse_RFS_FAT_e:
parse_RFS_KRFS db 'KRFS'
parse_RFS_KRFS db 'KRFS'
parse_RFS_KRFS_e:
parse_Loader_Image db 'LoaderImage'
parse_Loader_Image db 'LoaderImage'
parse_Loader_Image_e:
parse_RamdiskFile db 'RamdiskFile'
parse_RamdiskFile db 'RamdiskFile'
parse_RamdiskFile_e:

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,7 @@
; names of its contributors may be used to endorse or promote products
; derived from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY Alexey Teplov aka <Lrz> ''AS IS'' AND ANY
; THIS SOFTWARE IS PROVIDED BY Alexey Teplov nickname <Lrz> ''AS IS'' AND ANY
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY

View File

@ -0,0 +1,98 @@
; Copyright (c) 2008-2009, <Lrz>
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
; * Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; * Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in the
; documentation and/or other materials provided with the distribution.
; * Neither the name of the <organization> nor the
; names of its contributors may be used to endorse or promote products
; derived from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY Alexey Teplov aka <Lrz> ''AS IS'' AND ANY
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;*****************************************************************************
; Ïðåäîïðåäåëåíèÿ
DEBUG equ 1 ;êîìïèëÿöèÿ ñ îòëàäî÷íîé èíôîðìàöèåé =1 áåç îòëàäî÷íîé èíôîðàöèè =0
loop_read_startos_file equ 3 ;êîë-âî ïîïûòîê ñ÷èòàòü ÷åðåç callback ñåðâèñ ôàéë êîíôèãóðàöèè áëîê2
root_dir_entry_count equ 224 ;êîë-âî ýëåìåíòîâ â êîðíåâîé äèððåêòîðèè
;point_to_fat_struc equ 0xA000 ;âðåìåííûé áóôåð, êóäà áóäåò ðàçìåùåíà Fat òàáëèöà, è çàòåì ïåðåíåñåíà çà 1 ìá
ini_data_ equ 0x2000 ;ôàéë ãäå ðàçìåùåí ôàéë ñöåíàðèÿ çàãðóçêè, òàì ïðîèñõîäèò ñèíòàêñè÷åñêèé ðàçáîð
size_show_section equ 18
default_timeout_value equ 5 ;default value to timeout is will was some errors
flag_found_default equ 0x1 ;default value is found
flag_found_timeout equ 0x2 ;timeout value is found
flag_found_LM equ 0x1 ;found LM value
flag_found_RS equ 0x2 ;found RS value
flag_found_GTRFMS equ 0x4 ;found type RamFS
flag_found_RamdiskSector equ 0x8 ;found RamdiskSector
flag_found_RamdiskCluster equ 0x16 ;found RamdiskCluster
;statick data ýòè äàííûå íå ïðåäîïðåäåëÿþòñÿ â òå÷åíèè âûïîëíåíèÿ âñåé ïðîãðàììû.
save_cx equ word [bp-2] ;save cx size ini file
ret_on_ch equ word [bp-4] ;point to return ðàçðóøàåìîå çíà÷åíèå
save_cx_d equ word [bp-6] ;save cx - size default section and working section
status_flag equ word [bp-8] ;status flag
point_loader equ word [bp-10]
point_default equ word [bp-12] ;point to default
;äàííûå êîòîðûå çàâèñèìû îò âåòêè âûïîëíåíèÿ è êîòîðûå ìîãóò áûòü ïåðåîïðåäåëåíû â ïðîöåññå âûïîëíåíèÿ ïðîãðàììû.
point_to_hframe equ word [bp-14] ;point on start frame (for change section)
point_to_1 equ word [bp-16]
point_to_2 equ word [bp-18]
point_to_3 equ word [bp-20]
point_to_4 equ word [bp-22]
point_to_5 equ word [bp-24]
point_to_6 equ word [bp-26]
point_to_7 equ word [bp-28]
point_to_8 equ word [bp-30]
point_to_9 equ word [bp-32]
point_to_10 equ word [bp-34]
point_to_11 equ word [bp-36]
point_to_12 equ word [bp-38]
point_to_13 equ word [bp-40]
point_to_14 equ word [bp-42]
point_to_15 equ word [bp-44]
point_to_16 equ word [bp-46]
point_to_16 equ word [bp-48]
point_to_17 equ word [bp-50]
point_to_18 equ word [bp-52]
;here array for fast scroling 16 word - poin to start section
point_to_point_def equ word [bp-54]
point_to_eframe equ word [bp-56] ;point on point frame
; òóò ðàñïîëîæåíî âðåìåííîå õðàíèëèùå äëÿ cx è di ïðè ïåðåõîäå íà ñëåäóþùèé áóôåð ïðè ïîèñêå ñåêöèé
find_sec_di equ word [bp-58] ;òóò áóäåò õðàíèòüñÿ di
info_real_mode_size equ word [bp-60];òóò õðàíèòüñÿ èíôîðìàöèÿ î çàíÿòîé îáëàñòè ò.å. ðàçìåð, ìîæíî óçíàòü ñêîëüêî îñòàëîñü ìåñòà âû÷èñëèâ
free_ad_memory equ word [bp-62] ;ñêîëüêî ó íàñ ðàñøèðåííîé ïàìÿòè äëÿ ôîðìèðîâàíèÿ ðàì äèñêà è çàãðóçêè ìîäóëåé
show_errors_sect equ word [bp-64] ;ïåðåìåíàÿ êîòîðàÿ õðàíèò áèòû îøèáîê äëÿ êàæäîé ëîãè÷åñêîé ñåêöèè.
save_descript_size equ word [bp-66] ;save descript size previos section ñîõðàíèì ðàçìåð ïðåäûäóùåé ñåêöèè êîòîðóþ âûâîäèëè
save_ramdisksize equ dword [bp-70] ;save size of ramdisk in byte
save_file_size equ dword [bp-74] ;save size of reading file
set_ramfs equ word [bp-76] ;îïðåäåëåííûé òèï ôàéëîâîé ñèñòåìû,íóæíî äëÿ ôîðìèðîâàíèÿ ðàì äèñêà
point_next_fat_str equ word [bp-78] ;óêàçàòåëü íà ñëåäóþùèé ýëåìåíò fat òàáëèöû
size_root_dir equ word [bp-80] ;êîë-âî ýëåìåíòîâ â ñåêòîðàõ ïî 512 áàéò êîðíåâîé äèðåêòîðèè
firstDataSect equ word [bp-82] ;ïåðâûé ñåêòîð äàííûõ â ñåòîðàõ îò 0
DataClasters equ word [bp-84] ;ðàçìåð ìàññèâà äîñòóïíîé äëÿ çàïèñè äàííûõ â êëàñòåðàõ.
point_to_free_root equ word [bp-86] ;óêàçàòåëü íà ñëåäóþùèé ïóñòóþ çàïèñü â ðóò äèð
point_to_dest_file_name equ word [bp-88] ;óêàçûâàåò íà íà÷àëî èìåíè ôàéëà íàçíà÷åíèÿ.
data_offset equ word [bp-90] ;ñìåùåíèå â êëàñòåðàõ äëÿ çàïèñàííûõ äàííûõ ò.å ïåðåêèíóòûõ çà 1-é ìá
first_input equ word [bp-92] ;ïîëå äëÿ ôëàãîâ â ïðåîáðàçîâàíèè èìåíè.
save_di_RAMDISK equ word [bp-94] ;ñîõðàíèì di -óêàçàòåëÿ ïðè îáðàáîòêå ñåêöèè
save_cx_RAMDISK equ word [bp-96] ;ñîõðàíèì ðàçìåð îñòàòêà ñåêöèè
status_flag_loader_f equ word [bp-98] ;ñîõðàíèì ðåçóëüòàò âûïîëåíåíèÿ çàãðóçêè ôàéëà
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;äàííûå êîòîðûå èñïîëüçóþòñÿ ïðè îáðàáîòêå ñåêöèè, ò.å. ïîñëå íàæàòèÿ Enter, óæå íå âîçìîæíî âåðíóòüñÿ â ïåðâîíà÷àëüíûé ýêðàí
;äëÿ âîçâðàòà, íåîáõîäèìî ïåðåçàïóñòèòü ïîëíîñòüþ êîä ò.å. ñòàðòîâàòü ñ 0õ1000:0000