diff --git a/msdos/src/bus/int_f5.c b/msdos/src/bus/int_f5.c index d8e78a1..1dae0ff 100644 --- a/msdos/src/bus/int_f5.c +++ b/msdos/src/bus/int_f5.c @@ -12,18 +12,21 @@ */ #include +#include unsigned char int_f5(unsigned char dev, unsigned char command, unsigned char aux1, unsigned char aux2) { union REGS r; - + + memset(&r,0,sizeof(union REGS)); + r.h.dl = 0x00; r.h.al = dev; r.h.ah = command; r.h.cl = aux1; r.h.ch = aux2; r.x.si = 0x00; - + int86(0xF5,&r,&r); return r.h.al; diff --git a/msdos/src/bus/int_f5_read.c b/msdos/src/bus/int_f5_read.c index 109ea8e..da49a29 100644 --- a/msdos/src/bus/int_f5_read.c +++ b/msdos/src/bus/int_f5_read.c @@ -14,19 +14,23 @@ */ #include +#include unsigned char int_f5_read(unsigned char dev, unsigned char command, unsigned char aux1, unsigned char aux2, void *buf, unsigned short len) { union REGS r; struct SREGS sr; + memset(&r,0,sizeof(union REGS)); + memset(&sr,0,sizeof(struct SREGS)); + r.h.dl = 0x40; r.h.al = dev; r.h.ah = command; r.h.cl = aux1; r.h.ch = aux2; r.x.si = 0x00; - + sr.es = FP_SEG(buf); r.x.bx = FP_OFF(buf); r.x.di = len; diff --git a/msdos/src/bus/int_f5_write.c b/msdos/src/bus/int_f5_write.c index 306ade3..7ae28d9 100644 --- a/msdos/src/bus/int_f5_write.c +++ b/msdos/src/bus/int_f5_write.c @@ -14,19 +14,23 @@ */ #include +#include unsigned char int_f5_write(unsigned char dev, unsigned char command, unsigned char aux1, unsigned char aux2, void *buf, unsigned short len) { union REGS r; struct SREGS sr; + memset(&r,0,sizeof(union REGS)); + memset(&sr,0,sizeof(struct SREGS)); + r.h.dl = 0x80; r.h.al = dev; r.h.ah = command; r.h.cl = aux1; r.h.ch = aux2; r.x.si = 0x00; - + sr.es = FP_SEG(buf); r.x.bx = FP_OFF(buf); r.x.di = len; diff --git a/msdos/src/fn_network/network_status.c b/msdos/src/fn_network/network_status.c index aba0841..3ddda46 100644 --- a/msdos/src/fn_network/network_status.c +++ b/msdos/src/fn_network/network_status.c @@ -2,6 +2,7 @@ #include #include #include +#include uint8_t network_status(const char *devicespec, uint16_t *bw, uint8_t *c, uint8_t *err) { @@ -14,6 +15,8 @@ uint8_t network_status(const char *devicespec, uint16_t *bw, uint8_t *c, uint8_t uint8_t err; } sr; + memset(&sr,0,sizeof(sr)); + ret = int_f5_read(device,'S',0x00,0x00,&sr,sizeof(sr)); if (bw) @@ -22,6 +25,6 @@ uint8_t network_status(const char *devicespec, uint16_t *bw, uint8_t *c, uint8_t *c = sr.c; if (err) *err = sr.err; - - return ret; + + return ret == 'C' ? FN_ERR_OK : FN_ERR_IO_ERROR; }