Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 1378 → Rev 1377

/kernel/trunk/data32.inc
368,7 → 368,6
hdbase rd 1 ; for boot 0x1f0
hdid rd 1
hdpos rd 1 ; for boot 0x1
label known_part dword
fat32part rd 1 ; for boot 0x1
cdpos rd 1
 
465,4 → 464,3
BiosDiskPartitions rd 80h
 
IncludeUGlobals
 
/kernel/trunk/kernel32.inc
217,7 → 217,6
include "blkdev/rd.inc" ; ramdisk read /write
include "fs/fs_lfn.inc" ; syscall, version 2
include "fs/iso9660.inc" ; read for iso9660 filesystem CD
include "fs/ext2.inc" ; read / write for ext2 filesystem
 
; sound
 
287,4 → 286,3
 
; list of external functions
include "imports.inc"
 
/kernel/trunk/fs/ext2.inc
File deleted
Property changes:
Deleted: svn:keywords
-Rev
\ No newline at end of property
/kernel/trunk/fs/fat32.inc
169,6 → 169,7
call clear_hd_cache
@@:
pop eax
sti
.ret:
ret
 
1048,8 → 1049,6
jz @f
cmp [fs_type], 1
jz ntfs_HdRead
cmp [fs_type], 2
jz ext2_HdRead
or ebx, -1
mov eax, ERROR_UNKNOWN_FS
ret
1201,8 → 1200,6
fs_HdReadFolder:
cmp [fs_type], 1
jz ntfs_HdReadFolder
cmp [fs_type], 2
jz ext2_HdReadFolder
cmp [fs_type], 16
jz @f
cmp [fs_type], 32
1589,8 → 1586,6
.common:
cmp [fs_type], 1
jz ntfs_HdRewrite
cmp [fs_type], 2
jz ext2_HdRewrite
cmp [fs_type], 16
jz @f
cmp [fs_type], 32
2125,8 → 2120,6
fs_HdWrite:
cmp [fs_type], 1
jz ntfs_HdWrite
cmp [fs_type], 2
jz ext2_HdWrite
cmp [fs_type], 16
jz @f
cmp [fs_type], 32
2470,8 → 2463,6
fs_HdSetFileEnd:
cmp [fs_type], 1
jz ntfs_HdSetFileEnd
cmp [fs_type], 2
jz ext2_HdSetFileEnd
cmp [fs_type], 16
jz @f
cmp [fs_type], 32
2704,8 → 2695,6
fs_HdGetFileInfo:
cmp [fs_type], 1
jz ntfs_HdGetFileInfo
cmp [fs_type], 2
jz ext2_HdGetFileInfo
cmp [fs_type], 16
jz @f
cmp [fs_type], 32
2734,8 → 2723,6
fs_HdSetFileInfo:
cmp [fs_type], 1
jz ntfs_HdSetFileInfo
cmp [fs_type], 2
jz ext2_HdSetFileInfo
cmp [fs_type], 16
jz @f
cmp [fs_type], 32
2786,8 → 2773,6
fs_HdDelete:
cmp [fs_type], 1
jz ntfs_HdDelete
cmp [fs_type], 1
jz ext2_HdDelete
cmp [fs_type], 16
jz @f
cmp [fs_type], 32
2931,4 → 2916,3
ret
 
; \end{diamond}
 
/kernel/trunk/fs/fs_lfn.inc
105,11 → 105,6
; 9 : create directory
 
; parse file name
cmp dword [eax], 1
jne @F
;xchg bx,bx
@@:
;up to file_system_lfn - TEMP!!!
xchg ebx, eax
lea esi, [ebx+20]
lodsb
174,8 → 169,8
cmp dword [ebx], 1
jnz .access_denied
xor eax, eax
mov ebp, [ebx+12] ;количество блоков для считывания
mov edx, [ebx+16] ;куда записывать рузельтат
mov ebp, [ebx+12]
mov edx, [ebx+16]
; add edx, std_application_base_address
push dword [ebx+4] ; first block
mov ebx, [ebx+8] ; flags
187,7 → 182,7
pop ecx
mov byte [edx], 1 ; version
.maindir_loop:
call esi ;!!!!!!!!!!!!!!!!!!
call esi
jc .maindir_done
inc dword [edx+8]
dec dword [esp]
542,7 → 537,7
mov dword [image_of_eax], 5 ; not found
ret
@@:
mov [known_part], ecx ; mov [fat32part], ecx
mov [fat32part], ecx
push ebx esi
call choice_necessity_partition_1
pop esi ebx
1148,4 → 1143,3
jz .ret.ok
mov byte [edi-1], '/'
jmp .set_copy_cont
 
/kernel/trunk/fs/part_set.inc
26,7 → 26,7
;******************************************************
PARTITION_START dd 0x3f
PARTITION_END dd 0
fs_type db 0 ; 0=none, 1=NTFS, 2=EXT2/3, 16=FAT16, 32=FAT32
fs_type db 0 ; 0=none, 1=NTFS, 16=FAT16, 32=FAT32
align 4
 
fs_dependent_data_start:
78,28 → 78,6
end if
end virtual
 
virtual at fs_dependent_data_start
; EXT2 data
ext2_data:
.log_block_size dd ?
.block_size dd ?
.count_block_in_block dd ?
.blocks_per_group dd ?
.inodes_per_group dd ?
.global_desc_table dd ?
.root_inode dd ? ; pointer to root inode in memory
.inode_size dd ?
.count_pointer_in_block dd ? ; block_size / 4
.count_pointer_in_block_square dd ? ; (block_size / 4)**2
.ext2_save_block dd ? ; ¡«®ª ­  £«®¡ «ì­ãî 1 ¯à®æ¥¤ãàã
.ext2_temp_block dd ? ; ¡«®ª ¤«ï ¬¥«ª¨å ¯à®æ¥¤ãà
.ext2_save_inode dd ? ; inode ­  £«®¡ «ì­ãî ¯à®æ¥¤ãàã
.ext2_temp_inode dd ? ; inode ¤«ï ¬¥«ª¨å ¯à®æ¥¤ãà
if $ > fs_dependent_data_end
ERROR: increase sizeof(fs_dependent_data)!
end if
end virtual
 
;***************************************************************************
; End place
; Mario79
126,8 → 104,7
db 0xd4 ; Old Multiuser DOS secured: fat16 <32M
db 0xd6 ; Old Multiuser DOS secured: fat16 >32M
db 0x07 ; NTFS
db 0x17 ; NTFS, hidden
db 0x83 ; Linux native file system (ext2fs)
db 0x27 ; NTFS, hidden
partition_types_end:
 
 
141,15 → 118,17
endg
 
; Partition chain used:
; MBR <---------------------
; | |
; |-> PARTITION1 |
; |-> EXTENDED PARTITION - ;not need be second partition
; |-> PARTITION3
; |-> PARTITION4
; MBR ; PARTITION2 ; PARTITION3 ; PARTITION4
;==========================================================
; fat16/32 +-- fat16/32 +-- fat16/32 +-- fat16/32 +--
; extended --+ extended --+ extended --+ extended --+
; 0 0 0 0
; 0 0 0 0
; Notes:
; - extended partition need to be in second entry on table
; - it will skip over removed partitions
 
set_PARTITION_variables:
set_FAT32_variables: ;deprecated
set_FAT32_variables:
mov [problem_partition],0
call reserve_hd1
call reserve_hd_channel
160,12 → 139,12
je problem_hd
 
xor ecx,ecx ; partition count
or edx,-1 ; flag for partition
xor eax,eax ; address MBR
mov edx,-1 ; flag for partition
xor eax,eax ; read MBR
xor ebp,ebp ; extended partition start
 
new_mbr:
test ebp,ebp ; is there extended partition? (MBR or EMBR)
new_partition:
test ebp,ebp ; is there extended partition?
jnz extended_already_set ; yes
xchg ebp,eax ; no. set it now
 
179,25 → 158,26
cmp word [ebx+0x1fe],0xaa55 ; is it valid boot sector?
jnz end_partition_chain
cmp dword [ebx+0x1be+0xc],0 ; skip over empty partition
jnz test_primary_partition_0
; jz next_partition
jnz .next_primary_partition
cmp dword [ebx+0x1be+0xc+16],0
jnz test_primary_partition_1
jnz next_primary_partition
cmp dword [ebx+0x1be+0xc+16+16],0
jnz test_primary_partition_2
jnz next_primary_partition_1
cmp dword [ebx+0x1be+0xc+16+16+16],0
jnz test_primary_partition_3
jmp end_partition_chain
jnz next_primary_partition_2
jmp next_partition
 
test_primary_partition_0:
.next_primary_partition:
push eax
mov al,[ebx+0x1be+4] ; get primary partition type
call scan_partition_types
pop eax
jnz test_primary_partition_1 ; no. skip over
jnz next_primary_partition ; no. skip over
 
inc ecx
cmp ecx,[known_part] ; is it wanted partition?
jnz test_primary_partition_1 ; no
cmp ecx,[fat32part] ; is it wanted partition?
jnz next_primary_partition ; no
 
mov edx, eax ; start sector
add edx, [ebx+0x1be+8] ; add relative start
210,16 → 190,16
mov [fs_type], dl ; save for FS recognizer (separate FAT vs NTFS)
pop edx
 
test_primary_partition_1:
next_primary_partition:
push eax
mov al,[ebx+0x1be+4+16] ; get primary partition type
call scan_partition_types
pop eax
jnz test_primary_partition_2 ; no. skip over
jnz next_primary_partition_1 ; no. skip over
 
inc ecx
cmp ecx,[known_part] ; is it wanted partition?
jnz test_primary_partition_2 ; no
cmp ecx,[fat32part] ; is it wanted partition?
jnz next_primary_partition_1 ; no
 
mov edx, eax
add edx, [ebx+0x1be+8+16]
231,16 → 211,16
mov [fs_type], dl
pop edx
 
test_primary_partition_2:
next_primary_partition_1:
push eax
mov al,[ebx+0x1be+4+16+16] ; get primary partition type
call scan_partition_types
pop eax
jnz test_primary_partition_3 ; no. skip over
jnz next_primary_partition_2 ; no. skip over
 
inc ecx
cmp ecx,[known_part] ; is it wanted partition?
jnz test_primary_partition_3 ; no
cmp ecx,[fat32part] ; is it wanted partition?
jnz next_primary_partition_2 ; no
 
mov edx, eax
add edx, [ebx+0x1be+8+16+16]
252,16 → 232,16
mov [fs_type], dl
pop edx
 
test_primary_partition_3:
next_primary_partition_2:
push eax
mov al,[ebx+0x1be+4+16+16+16] ; get primary partition type
call scan_partition_types
pop eax
jnz test_ext_partition_0 ; no. skip over
jnz next_partition ; no. skip over
 
inc ecx
cmp ecx,[known_part] ; is it wanted partition?
jnz test_ext_partition_0 ; no
cmp ecx,[fat32part] ; is it wanted partition?
jnz next_partition ; no
 
mov edx, eax
add edx, [ebx+0x1be+8+16+16+16]
273,40 → 253,40
mov [fs_type], dl
pop edx
 
test_ext_partition_0:
next_partition:
push eax
mov al,[ebx+0x1be+4] ; get extended partition type
call scan_extended_types
pop eax
jnz test_ext_partition_1
jnz next_partition_1
 
mov eax,[ebx+0x1be+8] ; add relative start
test eax,eax ; is there extended partition?
jnz new_mbr ; yes. read it
jnz new_partition ; yes. read it
 
test_ext_partition_1:
next_partition_1:
push eax
mov al,[ebx+0x1be+4+16] ; get extended partition type
call scan_extended_types
pop eax
jnz test_ext_partition_2
jnz next_partition_2
 
mov eax,[ebx+0x1be+8+16] ; add relative start
test eax,eax ; is there extended partition?
jnz new_mbr ; yes. read it
jnz new_partition ; yes. read it
 
test_ext_partition_2:
next_partition_2:
push eax
mov al,[ebx+0x1be+4+16+16] ; get extended partition type
call scan_extended_types
pop eax
jnz test_ext_partition_3
jnz next_partition_3
 
mov eax,[ebx+0x1be+8+16+16] ; add relative start
test eax,eax ; is there extended partition?
jnz new_mbr ; yes. read it
jnz new_partition ; yes. read it
 
test_ext_partition_3:
next_partition_3:
push eax
mov al,[ebx+0x1be+4+16+16+16] ; get extended partition type
call scan_extended_types
315,7 → 295,7
 
mov eax,[ebx+0x1be+8+16+16+16] ; get start of extended partition
test eax,eax ; is there extended partition?
jnz new_mbr ; yes. read it
jnz new_partition ; yes. read it
 
end_partition_chain:
mov [partition_count],ecx
386,22 → 366,15
add eax, [PARTITION_START]
call hd_read
cmp [hd_error], 0
jnz problem_fat_dec_count ; no chance...
jnz problem_fat_dec_count ; ­¥ áã¤ì¡ ...
boot_read_ok:
 
; mov [hd_setup], 0
; if we are running on NTFS, check bootsector
 
call ntfs_test_bootsec ; test ntfs
; cmp [fs_type], 7
; jz ntfs_setup
call ntfs_test_bootsec
jnc ntfs_setup
 
call ext2_test_superblock ; test ext2fs
jnc ext2_setup
 
mov eax, [PARTITION_START] ;ext2 test changes [buffer]
call hd_read
cmp [hd_error], 0
jnz problem_fat_dec_count
 
cmp word [ebx+0x1fe],0xaa55 ; is it valid boot sector?
jnz problem_fat_dec_count
 
506,4 → 479,3
call free_hd_channel
mov [hd1_status],0 ; free
ret
 
/kernel/trunk/fs/fs.inc
388,7 → 388,7
.s:
sub eax,ebx
.f:
add eax, [known_part] ; add eax,[fat32part]
add eax,[fat32part]
dec eax
xor edx,edx
imul eax,100
795,4 → 795,3
 
partition_string: dd 0
db 32
 
/kernel/trunk/fs/ntfs.inc
95,8 → 95,8
 
ntfs_setup: ; CODE XREF: part_set.inc
; By given bootsector, initialize some NTFS variables
; call ntfs_test_bootsec
; jc problem_fat_dec_count
call ntfs_test_bootsec
jc problem_fat_dec_count
movzx eax, byte [ebx+13]
mov [ntfs_data.sectors_per_cluster], eax
mov eax, [ebx+0x28]
1268,7 → 1268,6
;
;--------------------------------------------------------------
ntfs_HdReadFolder:
xchg bx, bx
mov eax, 5 ; root cluster
cmp byte [esi], 0
jz .doit
1814,4 → 1813,3
pop edi esi
xor eax, eax
ret
 
/kernel/trunk/detect/sear_par.inc
20,15 → 20,15
mov [hdbase],0x1f0
mov [hdid],0x0
mov [hdpos],1
mov [known_part],1
mov [fat32part],1
search_partitions_ide0_1:
call set_PARTITION_variables
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 [known_part]
inc [fat32part]
jmp search_partitions_ide0_1
 
search_partitions_ide1:
37,15 → 37,15
mov [hdbase],0x1f0
mov [hdid],0x10
mov [hdpos],2
mov [known_part],1
mov [fat32part],1
search_partitions_ide1_1:
call set_PARTITION_variables
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 [known_part]
inc [fat32part]
jmp search_partitions_ide1_1
 
search_partitions_ide2:
54,15 → 54,15
mov [hdbase],0x170
mov [hdid],0x0
mov [hdpos],3
mov [known_part],1
mov [fat32part],1
search_partitions_ide2_1:
call set_PARTITION_variables
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 [known_part]
inc [fat32part]
jmp search_partitions_ide2_1
 
search_partitions_ide3:
71,15 → 71,15
mov [hdbase],0x170
mov [hdid],0x10
mov [hdpos],4
mov [known_part],1
mov [fat32part],1
search_partitions_ide3_1:
call set_PARTITION_variables
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 [known_part]
inc [fat32part]
jmp search_partitions_ide3_1
 
end_search_partitions_ide:
91,9 → 91,9
push ecx
mov eax, [hdpos]
and [BiosDiskPartitions+(eax-80h)*4], 0
mov [known_part], 1
mov [fat32part], 1
search_partitions_bd:
call set_PARTITION_variables
call set_FAT32_variables
cmp [problem_partition], 0
jne end_search_partitions_bd
mov eax, [hdpos]
100,7 → 100,7
inc [BiosDiskPartitions+(eax-80h)*4]
call partition_data_transfer
add [transfer_adress], 100
inc [known_part]
inc [fat32part]
jmp search_partitions_bd
end_search_partitions_bd:
pop ecx
110,7 → 110,7
 
partition_data_transfer:
mov edi,[transfer_adress]
mov esi,PARTITION_START ;start of file_system_data
mov esi,PARTITION_START
mov ecx,(file_system_data_size+3)/4
rep movsd
ret