An universal way how to flush disk cache? (Developers)
Here's Jack Ellis' code for CC.COM (part of his UIDE driver package):
page 59,132
title CC -- Clear Cache.
.386p ;Allow use of 80386 commands.
s equ <short> ;Make conditional jumps "short".
HDISKS equ 00475h ;BIOS hard-disk count address.
;
; Segment Declarations.
;
CODE segment public use16 'CODE'
assume cs:CODE,ds:CODE
org 00100h
;
; Main Program Routine.
;
Start: mov ax,cs ;Set our DS-register.
mov ds,ax
xor ax,ax ;Point ES-reg. to low-memory.
mov es,ax
mov al,es:HDISKS ;Get number of BIOS hard-disks.
or al,al ;Any hard-disks on this system?
jz s Exit ;No, just exit.
mov DiskCt,al ;Set our hard-disk count below.
Next: mov ah,0 ;Do BIOS "reset" for next disk.
mov dl,UnitNo
int 013h
mov ax,cs ;Reset our DS-register.
mov ds,ax
inc UnitNo ;Increment disk unit number.
dec DiskCt ;More disks to go?
jnz s Next ;Yes, go reset next one.
Exit: mov ax,04C00h ;Done -- Exit back to DOS.
int 021h
;
; Program Variables.
;
DiskCt db 0 ;Number of BIOS hard-disks.
UnitNo db 080h ;Current BIOS unit number.
CODE ends
end Start
Source: Jack R. Ellis Drivers
---
Forum admin
Complete thread:
- An universal way how to flush disk cache? - RayeR, 25.10.2011, 12:53 (Developers)
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- An universal way how to flush disk cache? - Arjay, 25.10.2011, 18:33
- An universal way how to flush disk cache? - rr, 25.10.2011, 20:27
- An universal way how to flush disk cache? - RayeR, 26.10.2011, 04:30
- An universal way how to flush disk cache? - bretjohn, 27.10.2011, 02:19
- An universal way how to flush disk cache? - rr, 28.10.2011, 21:39
- An universal way how to flush disk cache? - RayeR, 26.10.2011, 04:30
- An universal way how to flush disk cache? - Mpxplay, 12.11.2011, 01:24
Mix view