Classes | |
struct | CACHE_ITEM |
This structure describes one item in the cache. More... | |
Functions | |
void | cache_lookup_read () |
Lookup for the given sector in the given cache. If the sector is not present, return error. The caller must acquire the cache lock. in: edx:eax = sector in: ebx -> DISKCACHE structure out: CF set if sector is not in cache out: ecx = sector_size_log out: esi -> sector:status out: edi -> sector data. More... | |
void | cache_lookup_write () |
Lookup for the given sector in the given cache. If the sector is not present, allocate space for it, possibly flushing data. in: edx:eax = sector in: ebx -> DISKCACHE structure in: ebp -> PARTITION structure out: eax = error code out: esi -> sector:status out: edi -> sector data. More... | |
void | write_cache64 () |
Flush the given cache. The caller must acquire the cache lock. in: ebx -> DISKCACHE in: first argument in stdcall convention -> PARTITION. More... | |
Variables | |
label | fs_read64_sys |
Read several sequential sectors using cache #1. in: edx:eax = start sector, relative to start of partition in: ecx = number of sectors to read in: ebx -> buffer in: ebp -> PARTITION out: eax = error code, 0 = ok out: ecx = number of sectors that were read. More... | |
label | fs_read64_app |
Read several sequential sectors using cache #2. in: edx:eax = start sector, relative to start of partition in: ecx = number of sectors to read in: ebx -> buffer in: ebp -> PARTITION out: eax = error code, 0 = ok out: ecx = number of sectors that were read. More... | |
label | fs_read64_common |
Common part of fs_read64_{app,sys}: read several sequential sectors using the given cache. More... | |
dd | _num_sectors_orig |
dd | _num_sectors |
Number of sectors that should be read. Used to generate output value of ecx. More... | |
dd | _sector_lo |
Number of sectors that remain to be read. Decreases from .num_sectors_orig to 0. low 32 bits of the current sector. More... | |
dd | _sector_hi |
high 32 bits of the current sector More... | |
dd | _cache |
pointer to DISKCACHE More... | |
dd | _error_code |
current status More... | |
rd | _saved_regs |
dd | _buffer |
filled by fs_read64_{sys,app} More... | |
dd | _current_num_sectors |
number of sectors that were read More... | |
dd | _current_buffer |
pointer to data that are currently copying More... | |
dd | _allocated_buffer |
pointer inside .allocated_buffer that points to the beginning of not-processed data saved in safe place More... | |
dd | _iteration_size |
saved in safe place More... | |
label | fs_write64_sys |
Write several sequential sectors using cache #1. in: edx:eax = start sector in: ecx = number of sectors to write in: ebx -> buffer in: ebp -> PARTITION out: eax = error code, 0 = ok out: ecx = number of sectors that were written. More... | |
label | fs_write64_app |
Write several sequential sectors using cache #2. in: edx:eax = start sector in: ecx = number of sectors to write in: ebx -> buffer in: ebp -> PARTITION out: eax = error code, 0 = ok out: ecx = number of sectors that were written. More... | |
label | fs_write64_common |
Common part of fs_write64_{app,sys}: write several sequential sectors using the given cache. More... | |
dd | _cur_buffer |
pointer to data that are currently copying More... | |
label | fs_read32_sys |
Legacy. Use fs_read64_sys instead. This function is intended to replace the old 'hd_read' function when [hdd_appl_data] = 0, so its input/output parameters are the same, except that it can't use the global variables 'hd_error' and 'hdd_appl_data'. in: eax = sector, ebx = buffer, ebp = pointer to PARTITION structure eax is relative to partition start out: eax = error code; 0 = ok. More... | |
label | fs_read32_app |
Legacy. Use fs_read64_app instead. This function is intended to replace the old 'hd_read' function when [hdd_appl_data] = 1, so its input/output parameters are the same, except that it can't use the global variables 'hd_error' and 'hdd_appl_data'. in: eax = sector, ebx = buffer, ebp = pointer to PARTITION structure eax is relative to partition start out: eax = error code; 0 = ok. More... | |
label | fs_read32_common |
This label is the common part of fs_read32_sys and fs_read32_app. More... | |
label | fs_write32_sys |
This function is intended to replace the old 'hd_write' function when [hdd_appl_data] = 0, so its input/output parameters are the same, except that it can't use the global variables 'hd_error' and 'hdd_appl_data'. in: eax = sector, ebx = buffer, ebp = pointer to PARTITION structure eax is relative to partition start out: eax = error code; 0 = ok. More... | |
label | fs_write32_app |
This function is intended to replace the old 'hd_write' function when [hdd_appl_data] = 1, so its input/output parameters are the same, except that it can't use the global variables 'hd_error' and 'hdd_appl_data'. in: eax = sector, ebx = buffer, ebp = pointer to PARTITION structure eax is relative to partition start out: eax = error code; 0 = ok. More... | |
dd | _cache_end |
item past the end of the cache More... | |
dd | _size_left |
items left to scan More... | |
dd | _current_ptr |
pointer to the current item More... | |
dd | _sequential |
Write operations are coalesced in chains, one chain describes a sequential interval of sectors, they can be sequential or scattered in the cache. More... | |
dd | _chain_start_pos |
boolean variable, 1 if the current chain is sequential in the cache, 0 if additional buffer is needed to perform the operation data of chain start item More... | |
dd | _chain_start_ptr |
pointer to chain start item More... | |
dd | _chain_size |
chain size (thanks, C.O.) More... | |
dd | _iteration_buffer |
If the chain size is too large, split the operation to several iterations. This is size in sectors for one iterations. temporary buffer for non-sequential chains. More... | |
dd | _disk |
first argument More... | |
label | disk_init_cache |
This internal function is called from disk_add to initialize the caching for a new DISK. The algorithm is inherited from getcache.inc: take 1/32 part of the available physical memory, round down to 8 pages, limit by 128K from below and by 1M from above. Reserve 1/8 part of the cache for system data and 7/8 for app data. After the size is calculated, but before the cache is allocated, the device driver can adjust the size. In particular, setting size to zero disables caching: there is no sense in a cache for a ramdisk. In fact, such action is most useful example of a non-trivial adjustment. esi = pointer to DISK structure. More... | |
label | calculate_cache_slots |
label | disk_free_cache |
This internal function is called from disk_media_dereference to free the allocated cache, if there is one. esi = pointer to DISK structure. More... | |
label | disk_sync |
This function flushes all modified data from both caches for the given DISK. esi = pointer to DISK. More... | |
void cache_lookup_read | ( | ) |
Lookup for the given sector in the given cache. If the sector is not present, return error. The caller must acquire the cache lock. in: edx:eax = sector in: ebx -> DISKCACHE structure out: CF set if sector is not in cache out: ecx = sector_size_log out: esi -> sector:status out: edi -> sector data.
void cache_lookup_write | ( | ) |
void write_cache64 | ( | ) |
dd _allocated_buffer |
pointer inside .allocated_buffer that points to the beginning of not-processed data saved in safe place
saved at safe place
dd _buffer |
filled by fs_read64_{sys,app}
filled by fs_write64_{sys,app}
dd _cache |
dd _cache_end |
dd _chain_size |
dd _chain_start_pos |
boolean variable, 1 if the current chain is sequential in the cache, 0 if additional buffer is needed to perform the operation data of chain start item
dd _chain_start_ptr |
dd _cur_buffer |
dd _current_buffer |
pointer to data that are currently copying
dd _current_num_sectors |
dd _current_ptr |
dd _disk |
dd _error_code |
dd _iteration_buffer |
If the chain size is too large, split the operation to several iterations. This is size in sectors for one iterations. temporary buffer for non-sequential chains.
dd _iteration_size |
saved in safe place
dd _num_sectors |
Number of sectors that should be read. Used to generate output value of ecx.
number of sectors left
Number of sectors that should be written. Used to generate output value of ecx.
dd _num_sectors_orig |
rd _saved_regs |
dd _sector_hi |
high 32 bits of the current sector
dd _sector_lo |
Number of sectors that remain to be read. Decreases from .num_sectors_orig to 0. low 32 bits of the current sector.
Number of sectors that remain to be written. low 32 bits of the current sector.
dd _sequential |
Write operations are coalesced in chains, one chain describes a sequential interval of sectors, they can be sequential or scattered in the cache.
dd _size_left |
label calculate_cache_slots |
label disk_free_cache |
This internal function is called from disk_media_dereference to free the allocated cache, if there is one. esi = pointer to DISK structure.
label disk_init_cache |
This internal function is called from disk_add to initialize the caching for a new DISK. The algorithm is inherited from getcache.inc: take 1/32 part of the available physical memory, round down to 8 pages, limit by 128K from below and by 1M from above. Reserve 1/8 part of the cache for system data and 7/8 for app data. After the size is calculated, but before the cache is allocated, the device driver can adjust the size. In particular, setting size to zero disables caching: there is no sense in a cache for a ramdisk. In fact, such action is most useful example of a non-trivial adjustment. esi = pointer to DISK structure.
label disk_sync |
label fs_read32_app |
Legacy. Use fs_read64_app instead. This function is intended to replace the old 'hd_read' function when [hdd_appl_data] = 1, so its input/output parameters are the same, except that it can't use the global variables 'hd_error' and 'hdd_appl_data'. in: eax = sector, ebx = buffer, ebp = pointer to PARTITION structure eax is relative to partition start out: eax = error code; 0 = ok.
label fs_read32_common |
This label is the common part of fs_read32_sys and fs_read32_app.
label fs_read32_sys |
Legacy. Use fs_read64_sys instead. This function is intended to replace the old 'hd_read' function when [hdd_appl_data] = 0, so its input/output parameters are the same, except that it can't use the global variables 'hd_error' and 'hdd_appl_data'. in: eax = sector, ebx = buffer, ebp = pointer to PARTITION structure eax is relative to partition start out: eax = error code; 0 = ok.
label fs_read64_app |
Read several sequential sectors using cache #2. in: edx:eax = start sector, relative to start of partition in: ecx = number of sectors to read in: ebx -> buffer in: ebp -> PARTITION out: eax = error code, 0 = ok out: ecx = number of sectors that were read.
label fs_read64_common |
Common part of fs_read64_{app,sys}: read several sequential sectors using the given cache.
label fs_read64_sys |
Read several sequential sectors using cache #1. in: edx:eax = start sector, relative to start of partition in: ecx = number of sectors to read in: ebx -> buffer in: ebp -> PARTITION out: eax = error code, 0 = ok out: ecx = number of sectors that were read.
label fs_write32_app |
This function is intended to replace the old 'hd_write' function when [hdd_appl_data] = 1, so its input/output parameters are the same, except that it can't use the global variables 'hd_error' and 'hdd_appl_data'. in: eax = sector, ebx = buffer, ebp = pointer to PARTITION structure eax is relative to partition start out: eax = error code; 0 = ok.
label fs_write32_sys |
This function is intended to replace the old 'hd_write' function when [hdd_appl_data] = 0, so its input/output parameters are the same, except that it can't use the global variables 'hd_error' and 'hdd_appl_data'. in: eax = sector, ebx = buffer, ebp = pointer to PARTITION structure eax is relative to partition start out: eax = error code; 0 = ok.
label fs_write64_app |
Write several sequential sectors using cache #2. in: edx:eax = start sector in: ecx = number of sectors to write in: ebx -> buffer in: ebp -> PARTITION out: eax = error code, 0 = ok out: ecx = number of sectors that were written.
label fs_write64_common |
Common part of fs_write64_{app,sys}: write several sequential sectors using the given cache.