forked from KolibriOS/kolibrios
make.sh from http://board.kolibrios.org/viewtopic.php?f=1&t=1459
git-svn-id: svn://kolibrios.org@1516 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
e8c7f3f1f6
commit
0d2b81dd89
@ -1423,9 +1423,9 @@ proc set_mtrr stdcall, base:dword,size:dword,mem_type:dword
|
|||||||
mov ebx, [size]
|
mov ebx, [size]
|
||||||
dec ebx
|
dec ebx
|
||||||
mov eax, 0xFFFFFFFF
|
mov eax, 0xFFFFFFFF
|
||||||
mov edx, 0x0000000F
|
; mov edx, 0x0000000F
|
||||||
sub eax, ebx
|
sub eax, ebx
|
||||||
sbb edx, 0
|
; sbb edx, 0
|
||||||
or eax, 0x800
|
or eax, 0x800
|
||||||
inc ecx
|
inc ecx
|
||||||
wrmsr
|
wrmsr
|
||||||
|
@ -246,6 +246,7 @@ iglobal
|
|||||||
dd file_system_lfn ; 70-Common file system interface, version 2
|
dd file_system_lfn ; 70-Common file system interface, version 2
|
||||||
dd syscall_window_settings ; 71-Window settings
|
dd syscall_window_settings ; 71-Window settings
|
||||||
dd sys_sendwindowmsg ; 72-Send window message
|
dd sys_sendwindowmsg ; 72-Send window message
|
||||||
|
dd ntfs_read_file_record_sysfn
|
||||||
times 255 - ( ($-servetable2) /4 ) dd undefined_syscall
|
times 255 - ( ($-servetable2) /4 ) dd undefined_syscall
|
||||||
dd sys_end ; -1-end application
|
dd sys_end ; -1-end application
|
||||||
|
|
||||||
|
@ -740,6 +740,7 @@ ntfs_read_attr:
|
|||||||
and eax, 0x1FF
|
and eax, 0x1FF
|
||||||
mov [ntfs_cur_tail], eax
|
mov [ntfs_cur_tail], eax
|
||||||
@@:
|
@@:
|
||||||
|
DEBUGF 1,'tail=%x, size=%x\n',[ntfs_cur_tail],[ntfs_cur_size]
|
||||||
cmp [ntfs_cur_size], 0
|
cmp [ntfs_cur_size], 0
|
||||||
jz .okret
|
jz .okret
|
||||||
mov eax, [ntfs_cur_offs]
|
mov eax, [ntfs_cur_offs]
|
||||||
@ -774,6 +775,7 @@ ntfs_read_attr:
|
|||||||
mov ecx, [ntfs_cur_size]
|
mov ecx, [ntfs_cur_size]
|
||||||
@@:
|
@@:
|
||||||
mov ebx, [ntfs_cur_buf]
|
mov ebx, [ntfs_cur_buf]
|
||||||
|
DEBUGF 1,'eax=%x,ecx=%x,ebx=%x,offs=%x,size=%x\n',eax,ecx,ebx,[ntfs_cur_offs],[ntfs_cur_size]
|
||||||
@@:
|
@@:
|
||||||
call hd_read
|
call hd_read
|
||||||
cmp [hd_error], 0
|
cmp [hd_error], 0
|
||||||
@ -785,6 +787,7 @@ ntfs_read_attr:
|
|||||||
dec [ntfs_cur_size]
|
dec [ntfs_cur_size]
|
||||||
inc [ntfs_cur_offs]
|
inc [ntfs_cur_offs]
|
||||||
loop @b
|
loop @b
|
||||||
|
DEBUGF 1,'cur_size=%x\n',[ntfs_cur_size]
|
||||||
pop ecx
|
pop ecx
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
xor edx, edx
|
xor edx, edx
|
||||||
@ -874,6 +877,16 @@ ntfs_read_file_record:
|
|||||||
xor eax, eax
|
xor eax, eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
ntfs_read_file_record_sysfn:
|
||||||
|
mov eax, ebx
|
||||||
|
call ntfs_read_file_record
|
||||||
|
mov [esp+20h], eax
|
||||||
|
mov edi, ecx
|
||||||
|
mov esi, [ntfs_data.frs_buffer]
|
||||||
|
mov ecx, 0x400/4
|
||||||
|
rep movsd
|
||||||
|
ret
|
||||||
|
|
||||||
ntfs_restore_usa_frs:
|
ntfs_restore_usa_frs:
|
||||||
mov eax, [ntfs_data.frs_size]
|
mov eax, [ntfs_data.frs_size]
|
||||||
ntfs_restore_usa:
|
ntfs_restore_usa:
|
||||||
@ -968,11 +981,15 @@ ntfs_find_lfn:
|
|||||||
mov [ntfs_cur_buf], eax
|
mov [ntfs_cur_buf], eax
|
||||||
call ntfs_read_attr
|
call ntfs_read_attr
|
||||||
jnc @f
|
jnc @f
|
||||||
|
DEBUGF 1,'ntfs_find_lfn: $INDEX_ROOT not found in %s\n',esi
|
||||||
.ret:
|
.ret:
|
||||||
ret
|
ret
|
||||||
@@:
|
@@:
|
||||||
cmp [ntfs_cur_read], 0x20
|
cmp [ntfs_cur_read], 0x20
|
||||||
jc .ret
|
jnc @f
|
||||||
|
DEBUGF 1,'ntfs_find_lfn: $INDEX_ROOT too small in %s\n',esi
|
||||||
|
jmp .ret
|
||||||
|
@@:
|
||||||
pushad
|
pushad
|
||||||
mov esi, [ntfs_data.cur_index_buf]
|
mov esi, [ntfs_data.cur_index_buf]
|
||||||
mov eax, [esi+14h]
|
mov eax, [esi+14h]
|
||||||
@ -983,6 +1000,7 @@ ntfs_find_lfn:
|
|||||||
shr eax, 9
|
shr eax, 9
|
||||||
cmp eax, [ntfs_data.cur_index_size]
|
cmp eax, [ntfs_data.cur_index_size]
|
||||||
ja @f
|
ja @f
|
||||||
|
DEBUGF 1,'ntfs_find_lfn: err1 in %s\n',[esp+4]
|
||||||
.stc_ret:
|
.stc_ret:
|
||||||
popad
|
popad
|
||||||
stc
|
stc
|
||||||
@ -998,6 +1016,7 @@ ntfs_find_lfn:
|
|||||||
call kernel_alloc
|
call kernel_alloc
|
||||||
test eax, eax
|
test eax, eax
|
||||||
jnz @f
|
jnz @f
|
||||||
|
DEBUGF 1,'ntfs_find_lfn: err2 in %s\n',[esp+4]
|
||||||
and [ntfs_data.cur_index_size], 0
|
and [ntfs_data.cur_index_size], 0
|
||||||
and [ntfs_data.cur_index_buf], 0
|
and [ntfs_data.cur_index_buf], 0
|
||||||
jmp .stc_ret
|
jmp .stc_ret
|
||||||
@ -1015,7 +1034,10 @@ ntfs_find_lfn:
|
|||||||
call kernel_alloc
|
call kernel_alloc
|
||||||
pop ebp esi
|
pop ebp esi
|
||||||
test eax, eax
|
test eax, eax
|
||||||
jz .stc_ret
|
jnz @f
|
||||||
|
DEBUGF 1,'ntfs_find_lfn: err3 in %s\n',[esp+4]
|
||||||
|
jmp .stc_ret
|
||||||
|
@@:
|
||||||
mov edi, eax
|
mov edi, eax
|
||||||
mov ecx, [ntfs_data.cur_index_size]
|
mov ecx, [ntfs_data.cur_index_size]
|
||||||
shl ecx, 9-2
|
shl ecx, 9-2
|
||||||
@ -1067,7 +1089,10 @@ ntfs_find_lfn:
|
|||||||
pop esi
|
pop esi
|
||||||
.subnode:
|
.subnode:
|
||||||
test byte [esi+0Ch], 1
|
test byte [esi+0Ch], 1
|
||||||
jz .notfound
|
jnz @f
|
||||||
|
DEBUGF 1,'ntfs_find_lfn: err4 in %s\n',[esp+4]
|
||||||
|
jmp .notfound
|
||||||
|
@@:
|
||||||
movzx eax, word [esi+8]
|
movzx eax, word [esi+8]
|
||||||
mov eax, [esi+eax-8]
|
mov eax, [esi+eax-8]
|
||||||
mul [ntfs_data.sectors_per_cluster]
|
mul [ntfs_data.sectors_per_cluster]
|
||||||
@ -1081,15 +1106,22 @@ ntfs_find_lfn:
|
|||||||
mov eax, ebp
|
mov eax, ebp
|
||||||
shl eax, 9
|
shl eax, 9
|
||||||
cmp [ntfs_cur_read], eax
|
cmp [ntfs_cur_read], eax
|
||||||
jnz .notfound
|
jz @f
|
||||||
|
DEBUGF 1,'ntfs_find_lfn: err5 in %s\n',[esp+4]
|
||||||
|
jmp .notfound
|
||||||
|
@@:
|
||||||
cmp dword [esi], 'INDX'
|
cmp dword [esi], 'INDX'
|
||||||
jnz .notfound
|
jz @f
|
||||||
|
DEBUGF 1,'ntfs_find_lfn: err6 in %s\n',[esp+4]
|
||||||
|
jmp .notfound
|
||||||
|
@@:
|
||||||
mov ebx, esi
|
mov ebx, esi
|
||||||
call ntfs_restore_usa
|
call ntfs_restore_usa
|
||||||
jc .notfound
|
jc .notfound
|
||||||
add esi, 0x18
|
add esi, 0x18
|
||||||
jmp .scanloop
|
jmp .scanloop
|
||||||
.notfound:
|
.notfound:
|
||||||
|
DEBUGF 1,'ntfs_find_lfn: .notfound in %s\n',[esp+4]
|
||||||
popad
|
popad
|
||||||
stc
|
stc
|
||||||
ret
|
ret
|
||||||
@ -1107,6 +1139,7 @@ ntfs_find_lfn:
|
|||||||
pop esi
|
pop esi
|
||||||
mov eax, [esi]
|
mov eax, [esi]
|
||||||
mov [ntfs_cur_iRecord], eax
|
mov [ntfs_cur_iRecord], eax
|
||||||
|
DEBUGF 1,'ntfs_find_lfn: 0x%x is irecord for %s\n',eax,[esp+4]
|
||||||
mov [esp+1Ch], esi
|
mov [esp+1Ch], esi
|
||||||
mov [esp+4], edi
|
mov [esp+4], edi
|
||||||
popad
|
popad
|
||||||
@ -1150,6 +1183,7 @@ ntfs_HdRead:
|
|||||||
pop eax
|
pop eax
|
||||||
ret
|
ret
|
||||||
.found:
|
.found:
|
||||||
|
DEBUGF 1,'ntfs_HdRead: irecord is 0x%x\n',[ntfs_cur_iRecord]
|
||||||
mov [ntfs_cur_attr], 0x80 ; $DATA
|
mov [ntfs_cur_attr], 0x80 ; $DATA
|
||||||
and [ntfs_cur_offs], 0
|
and [ntfs_cur_offs], 0
|
||||||
and [ntfs_cur_size], 0
|
and [ntfs_cur_size], 0
|
||||||
@ -1228,11 +1262,14 @@ ntfs_HdRead:
|
|||||||
mov eax, ecx
|
mov eax, ecx
|
||||||
shr eax, 9
|
shr eax, 9
|
||||||
mov [ntfs_cur_size], eax
|
mov [ntfs_cur_size], eax
|
||||||
|
; DEBUGF 1,'ntfs_HdRead: [ntfs_cur_offs]=%x\n',[ntfs_cur_offs]
|
||||||
|
; DEBUGF 1,'ntfs_HdRead: [ntfs_cur_size]=%x\n',[ntfs_cur_size]
|
||||||
add eax, [ntfs_cur_offs]
|
add eax, [ntfs_cur_offs]
|
||||||
push eax
|
push eax
|
||||||
call ntfs_read_attr.continue
|
call ntfs_read_attr.continue
|
||||||
pop [ntfs_cur_offs]
|
pop [ntfs_cur_offs]
|
||||||
mov eax, [ntfs_cur_read]
|
mov eax, [ntfs_cur_read]
|
||||||
|
; DEBUGF 1,'ntfs_HdRead: [ntfs_cur_read]=%x\n',[ntfs_cur_read]
|
||||||
add [esp+10h], eax
|
add [esp+10h], eax
|
||||||
mov eax, ecx
|
mov eax, ecx
|
||||||
and eax, not 0x1FF
|
and eax, not 0x1FF
|
||||||
@ -1285,6 +1322,7 @@ ntfs_HdReadFolder:
|
|||||||
jz .doit
|
jz .doit
|
||||||
call ntfs_find_lfn
|
call ntfs_find_lfn
|
||||||
jnc .doit2
|
jnc .doit2
|
||||||
|
DEBUGF 1,'ntfs_HdReadFolder: ntfs_find_lfn failed\n'
|
||||||
.notfound:
|
.notfound:
|
||||||
or ebx, -1
|
or ebx, -1
|
||||||
push ERROR_FILE_NOT_FOUND
|
push ERROR_FILE_NOT_FOUND
|
||||||
@ -1299,7 +1337,10 @@ ntfs_HdReadFolder:
|
|||||||
mov [ntfs_cur_size], 1
|
mov [ntfs_cur_size], 1
|
||||||
mov [ntfs_cur_buf], ntfs_bitmap_buf
|
mov [ntfs_cur_buf], ntfs_bitmap_buf
|
||||||
call ntfs_read_attr
|
call ntfs_read_attr
|
||||||
jc .notfound
|
jnc @f
|
||||||
|
DEBUGF 1,'ntfs_HdReadFolder: no $STANDARD_INFORMATION\n'
|
||||||
|
jmp .notfound
|
||||||
|
@@:
|
||||||
mov [ntfs_cur_attr], 0x90 ; $INDEX_ROOT
|
mov [ntfs_cur_attr], 0x90 ; $INDEX_ROOT
|
||||||
and [ntfs_cur_offs], 0
|
and [ntfs_cur_offs], 0
|
||||||
mov eax, [ntfs_data.cur_index_size]
|
mov eax, [ntfs_data.cur_index_size]
|
||||||
@ -1308,6 +1349,7 @@ ntfs_HdReadFolder:
|
|||||||
mov [ntfs_cur_buf], eax
|
mov [ntfs_cur_buf], eax
|
||||||
call ntfs_read_attr
|
call ntfs_read_attr
|
||||||
jnc .ok
|
jnc .ok
|
||||||
|
DEBUGF 1,'ntfs_HdReadFolder: no $INDEX_ROOT\n'
|
||||||
cmp [hd_error], 0
|
cmp [hd_error], 0
|
||||||
jz .notfound
|
jz .notfound
|
||||||
or ebx, -1
|
or ebx, -1
|
||||||
|
@ -4,6 +4,13 @@
|
|||||||
|
|
||||||
CLANG=$1;
|
CLANG=$1;
|
||||||
|
|
||||||
|
# set debug=true to print executed bash commands
|
||||||
|
debug=true
|
||||||
|
|
||||||
|
outDir=bin
|
||||||
|
outFileName=kernel.mnt
|
||||||
|
outFile=$outDir/$outFileName
|
||||||
|
|
||||||
usage()
|
usage()
|
||||||
{
|
{
|
||||||
echo "Usage: make.sh [en|ru|ge|et]"
|
echo "Usage: make.sh [en|ru|ge|et]"
|
||||||
@ -12,22 +19,33 @@ usage()
|
|||||||
|
|
||||||
compile()
|
compile()
|
||||||
{
|
{
|
||||||
fasm -m 65536 kernel.asm bin/kernel.mnt
|
if [ -d "$outDir" ]; then
|
||||||
|
$debug && echo "rm -f $outFile"
|
||||||
|
rm -f $outFile
|
||||||
|
else
|
||||||
|
$debug && echo "mkdir $outDir"
|
||||||
|
mkdir $outDir
|
||||||
|
fi
|
||||||
|
|
||||||
|
$debug && echo "fasm -m 65536 kernel.asm $outFile"
|
||||||
|
fasm -m 65536 kernel.asm $outFile
|
||||||
|
|
||||||
|
$debug && echo "rm -f lang.inc"
|
||||||
rm -f lang.inc
|
rm -f lang.inc
|
||||||
|
|
||||||
|
$debug && echo "exit 0"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if [ ! $CLANG ] ; then
|
if [ ! $CLANG ] ; then
|
||||||
usage
|
usage
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for i in "en" "ru" "ge" "et"; do
|
for i in "en" "ru" "ge" "et"; do
|
||||||
if [ $i == $CLANG ] ; then
|
if [ $i == $CLANG ] ; then
|
||||||
|
$debug && echo "echo \"lang fix \$i\" > lang.inc"
|
||||||
echo "lang fix $i" > lang.inc
|
echo "lang fix $i" > lang.inc
|
||||||
compile
|
compile
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
usage
|
usage
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user