M pc/devfloppy.c => pc/devfloppy.c +1 -1
@@ 792,7 792,7 @@ floppyxfer(Drive *dp, int cmd, void *a, long off, long n)
fl.cmd[fl.ncmd++] = dp->thead;
fl.cmd[fl.ncmd++] = dp->tsec;
fl.cmd[fl.ncmd++] = dp->t->bcode;
- fl.cmd[fl.ncmd++] = dp->tsec + dp->len/dp->t->bytes - 1;
+ fl.cmd[fl.ncmd++] = dp->t->sectors;
fl.cmd[fl.ncmd++] = dp->t->gpl;
fl.cmd[fl.ncmd++] = 0xFF;
if(floppycmd() < 0){
M pc/devuart.c => pc/devuart.c +3 -0
@@ 295,6 295,9 @@ uartenable(Uart *up)
if(up == &uart[Serial]){
if(serial(0) < 0)
print("can't turn on serial port power\n");
+ } else {
+ if(modem(0) < 0)
+ print("can't turn on modem speaker\n");
}
/*
M pc/fns.h => pc/fns.h +1 -0
@@ 27,6 27,7 @@ void inss(int, void*, int);
void kbdinit(void);
void mathinit(void);
void mmuinit(void);
+int modem(int);
void outb(int, int);
void outss(int, void*, int);
void prhex(ulong);
M pc/main.c => pc/main.c +13 -0
@@ 463,6 463,19 @@ serial(int onoff)
return pmuwrbit(1, onoff, 6);
}
+/*
+ * power to modem
+ * onoff == 0 means on
+ * onoff == 1 means off
+ */
+int
+modem(int onoff)
+{
+ if(pmuwrbit(1, onoff, 0)<0)
+ return -1;
+ return pmuwrbit(1, 1^onoff, 5);
+}
+
void
buzz(int f, int d)
{
M pc/trap.c => pc/trap.c +2 -2
@@ 35,8 35,8 @@ enum
EOI= 0x20, /* non-specific end of interrupt */
};
-int int0mask = 0x00; /* interrupts enabled for first 8259 */
-int int1mask = 0x00; /* interrupts enabled for second 8259 */
+int int0mask = 0xff; /* interrupts enabled for first 8259 */
+int int1mask = 0xff; /* interrupts enabled for second 8259 */
/*
* trap/interrupt gates