Hi!

Part 2:

- prototypes fixed and syncronized with dsk.c.

Note: I plan in the future join fl_read, fl_write, fl_verify and fl_format
into one function (similar to fl_lba_ReadWrite), consequently, I place those
prototypes near.

--- Begin Message ---
diff -ruNp old/drivers/floppy.asm new/drivers/floppy.asm
--- old/drivers/floppy.asm      2004-06-08 20:00:48.000000000 +0000
+++ new/drivers/floppy.asm      2004-06-08 20:10:34.000000000 +0000
@@ -28,15 +28,14 @@
 ; $Id: floppy.asm,v 1.18 2004/04/09 13:11:22 bartoldeman Exp $
 ;
 
-     %include "../kernel/segs.inc"
-     segment HMA_TEXT
-;
-;
-; Reset both the diskette and hard disk system
+%include "../kernel/segs.inc"
+segment HMA_TEXT
+
 ;
-; BOOL fl_reset(WORD drive)
+; int ASMPASCAL fl_reset(UBYTE drive);
 ;
-;       returns TRUE if successful
+; Reset both the diskette and hard disk system.
+; returns TRUE if successful.
 ;
 
                global  FL_RESET
@@ -51,14 +50,11 @@ FL_RESET:
                inc     ax              ; TRUE on success, FALSE on failure
                 ret
 
-
 ;
+; int ASMPASCAL fl_diskchanged(UBYTE drive);
 ;
-; Read disk change line status
-;
-; COUNT fl_diskchanged(WORD drive)
-;
-;       returns 1 if disk has changed, 0 if not, 0xFFFF if error
+; Read disk change line status.
+; returns 1 if disk has changed, 0 if not, 0xFFFF if error.
 ;
 
                global  FL_DISKCHANGED
@@ -85,35 +81,19 @@ fl_dc_ret:  cbw
                 ret
 
 ;
-; Format Sectors
-;
-; COUNT fl_format(WORD drive, WORD head, WORD track, WORD sector, WORD count, BYTE 
FAR *buffer);
-;
-; Formats one or more tracks, sector should be 0.
+; int ASMPASCAL fl_read  (UBYTE drive, WORD head, WORD track, WORD sector, WORD 
count, void FAR *buffer);
+; int ASMPASCAL fl_write (UBYTE drive, WORD head, WORD track, WORD sector, WORD 
count, void FAR *buffer);
+; int ASMPASCAL fl_verify(UBYTE drive, WORD head, WORD track, WORD sector, WORD 
count, void FAR *buffer);
+; int ASMPASCAL fl_format(UBYTE drive, WORD head, WORD track, WORD sector, WORD 
count, void FAR *buffer);
 ;
-; Returns 0 if successful, error code otherwise.
+
+; Format tracks (sector should be 0).
+
                global  FL_FORMAT
 FL_FORMAT:
                 mov     ah, 5
                 jmp     short fl_common
-;
-; Read Sectors
-;
-; COUNT fl_read(WORD drive, WORD head, WORD track, WORD sector, WORD count, BYTE FAR 
*buffer);
-;
-; Reads one or more sectors.
-;
-; Returns 0 if successful, error code otherwise.
-;
-;
-; Write Sectors
-;
-; COUNT fl_write(WORD drive, WORD head, WORD track, WORD sector, WORD count, BYTE FAR 
*buffer);
-;
-; Writes one or more sectors.
-;
-; Returns 0 if successful, error code otherwise.
-;
+
                global  FL_READ
 FL_READ:
                 mov     ah,2            ; cmd READ
@@ -160,11 +140,12 @@ fl_error:
                 pop     bp
                 ret     14
 
-
-; COUNT fl_lba_ReadWrite(BYTE drive, UWORD mode, VOID FAR *dap_p)
+;
+; int ASMPASCAL fl_lba_ReadWrite(UBYTE drive, WORD mode, void FAR * dap);
 ;
 ; Returns 0 if successful, error code otherwise.
 ;
+
                global  FL_LBA_READWRITE
 FL_LBA_READWRITE:
                push    bp              ; C entry
@@ -187,15 +168,19 @@ FL_LBA_READWRITE:
                ret     8
 
 ;
-; void fl_readkey (void);
+; void ASMPASCAL fl_readkey (void);
 ;
 
-global FL_READKEY
+               global  FL_READKEY
 FL_READKEY:     xor    ah, ah
                int     16h
                ret
 
-global FL_SETDISKTYPE
+;
+; int ASMPASCAL fl_setdisktype (UBYTE drive, WORD type);
+;
+
+               global  FL_SETDISKTYPE
 FL_SETDISKTYPE:
                pop     bx              ; return address
                pop     ax              ; disk type (al)
@@ -207,11 +192,12 @@ ret_AH:
                mov     al,ah           ; place error code into al
                mov     ah,0
                ret
-                        
+
 ;
-; COUNT fl_setmediatype (WORD drive, WORD tracks, WORD sectors);
+; int ASMPASCAL fl_setmediatype (UBYTE drive, WORD tracks, WORD sectors);
 ;
-global FL_SETMEDIATYPE
+
+               global  FL_SETMEDIATYPE
 FL_SETMEDIATYPE:
                pop     ax              ; return address
                 pop     bx             ; sectors/track

--- End Message ---

Reply via email to