Displaying 4 results from an estimated 4 matches for "search_dos_dir".
2009 May 24
0
malloc() in the core
...r (i = 0; i < cache_entries; i++) {
cur = cache[i];
cur->block = 0;
cur->prev = prev;
prev->next = cur;
cur->data = data;
data += block_size;
prev = cur++;
}
}
There is also one use of malloc() in search_dos_dir, but it looks like
it can simply be replaced by an automatic (stack) variable, either a
simple array or using alloca().
(It also doesn't look like it gets freed in the current code, which is
another good hint that it should be replaced by an automatic allocation.)
-hpa
--
H. Peter Anvin, I...
2009 Mar 31
1
[PATCH 1/1] CORE/cache: add cache priority parameter
...428,7 @@ linsector:
mov ebp,[gs:si+bx]
shl ebp,cl
add eax,ebp
+ mov dx,1
call getcachesector
pop bx
and bx,(SECTOR_SIZE >> 2)-1
diff --git a/core/ldlinux.asm b/core/ldlinux.asm
index b98cd92..9cbf428 100644
--- a/core/ldlinux.asm
+++ b/core/ldlinux.asm
@@ -1058,6 +1058,7 @@ search_dos_dir:
.scansector:
; EAX <- directory sector to scan
+ mov dx,1
call getcachesector
; GS:SI now points to this sector
@@ -1411,6 +1412,7 @@ readdir:
and eax,eax
jz .fail
.fetch_cache:
+ mov dx,1
call getcachesector
.move_current:
add si,bx ; Resume last position in sector...
2009 Feb 08
1
[PATCH 1/1] COMBOOT API: Add calls for directory functions; Implement for FAT; Try 2
...+ call allocate_file
+ jnz .alloc_failure
+.found:
+ mov si,bx
+ mov [si+file_sector],eax ; Current sector
+ mov dword [si+file_bytesleft],0 ; Current offset
+ mov [si+file_left],eax ; Beginning sector
+ pop bx
+ ret
+
+.alloc_failure:
+ pop bx
+ xor eax,eax ; ZF <- 1
+ ret
+
+;
; search_dos_dir:
; Search a specific directory for a pre-mangled filename in
; MangledBuf, in the directory starting in sector EAX.
@@ -1191,6 +1275,18 @@ close_file:
.closed: ret
;
+; close_dir:
+; Deallocates a directory structure (pointer in SI)
+; Assumes CS == DS.
+;
+close_dir:...
2008 Dec 04
2
[PATCH 1/1] COMBOOT API: Add calls for directory functions; Implement for FAT
...+ call allocate_file
+ jnz .alloc_failure
+.found:
+ mov si,bx
+ mov [si+file_sector],eax ; Current sector
+ mov dword [si+file_bytesleft],0 ; Current offset
+ mov [si+file_left],eax ; Beginning sector
+ pop bx
+ ret
+
+.alloc_failure:
+ pop bx
+ xor eax,eax ; ZF <- 1
+ ret
+
+;
; search_dos_dir:
; Search a specific directory for a pre-mangled filename in
; MangledBuf, in the directory starting in sector EAX.
@@ -1191,6 +1248,18 @@ close_file:
.closed: ret
;
+; close_dir:
+; Deallocates a directory structure (pointer in SI)
+; Assumes CS == DS.
+;
+close_dir:...