git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Modules/PS2KbMouse - Adding pl050 support
[tpg/acess2.git]
/
Modules
/
Storage
/
FDD
/
fdd.c
diff --git
a/Modules/Storage/FDD/fdd.c
b/Modules/Storage/FDD/fdd.c
index
801f2eb
..
5c2848f
100644
(file)
--- a/
Modules/Storage/FDD/fdd.c
+++ b/
Modules/Storage/FDD/fdd.c
@@
-6,7
+6,7
@@
#include <acess.h>
#include <modules.h>
#include <fs_devfs.h>
#include <acess.h>
#include <modules.h>
#include <fs_devfs.h>
-#include <
tpl
_drv_disk.h>
+#include <
api
_drv_disk.h>
#include <dma.h>
#include <iocache.h>
#include <dma.h>
#include <iocache.h>
@@
-107,7
+107,7
@@
Uint FDD_ReadSectors(Uint64 SectorAddr, Uint Count, void *Buffer, Uint Disk);
int FDD_ReadSector(Uint32 disk, Uint64 lba, void *Buffer);
int FDD_WriteSector(Uint32 Disk, Uint64 LBA, void *Buffer);
// --- Helpers
int FDD_ReadSector(Uint32 disk, Uint64 lba, void *Buffer);
int FDD_WriteSector(Uint32 Disk, Uint64 LBA, void *Buffer);
// --- Helpers
-void FDD_IRQHandler(int Num);
+void FDD_IRQHandler(int Num
, void *Ptr
);
inline void FDD_WaitIRQ();
void FDD_SensInt(int base, Uint8 *sr0, Uint8 *cyl);
int FDD_int_SendByte(int base, Uint8 Byte);
inline void FDD_WaitIRQ();
void FDD_SensInt(int base, Uint8 *sr0, Uint8 *cyl);
int FDD_int_SendByte(int base, Uint8 Byte);
@@
-172,11
+172,11
@@
int FDD_Install(char **Arguments)
}
// Install IRQ6 Handler
}
// Install IRQ6 Handler
- IRQ_AddHandler(6, FDD_IRQHandler);
+ IRQ_AddHandler(6, FDD_IRQHandler
, NULL
);
// Ensure the FDD version is 0x90
{
// Ensure the FDD version is 0x90
{
- Uint8 tmp;
+ Uint8 tmp
= 0
;
FDD_int_SendByte(cPORTBASE[0], CMD_VERSION);
FDD_int_GetByte(cPORTBASE[0], &tmp);
if( tmp != 0x90 ) {
FDD_int_SendByte(cPORTBASE[0], CMD_VERSION);
FDD_int_GetByte(cPORTBASE[0], &tmp);
if( tmp != 0x90 ) {
@@
-584,7
+584,7
@@
int FDD_WriteSector(Uint32 Disk, Uint64 LBA, void *Buffer)
*/
int FDD_int_SeekTrack(int disk, int head, int track)
{
*/
int FDD_int_SeekTrack(int disk, int head, int track)
{
- Uint8 sr0
, cyl
;
+ Uint8 sr0
=0, cyl=0
;
int base;
base = cPORTBASE[disk>>1];
int base;
base = cPORTBASE[disk>>1];
@@
-676,7
+676,7
@@
int FDD_int_GetDims(int type, int lba, int *c, int *h, int *s, int *spt)
* \fn void FDD_IRQHandler(int Num)
* \brief Handles IRQ6
*/
* \fn void FDD_IRQHandler(int Num)
* \brief Handles IRQ6
*/
-void FDD_IRQHandler(int Num)
+void FDD_IRQHandler(int Num
, void *Ptr
)
{
gbFDD_IrqFired = 1;
}
{
gbFDD_IrqFired = 1;
}
@@
-707,8
+707,12
@@
int FDD_int_SendByte(int base, Uint8 byte)
{
tTime end = now() + 1000; // 1s
{
tTime end = now() + 1000; // 1s
- while( (inb(base + PORT_MAINSTATUS) & 0x
C
0) != 0x80 && now() < end )
+ while( (inb(base + PORT_MAINSTATUS) & 0x
8
0) != 0x80 && now() < end )
Threads_Yield(); //Delay
Threads_Yield(); //Delay
+
+ if( inb(base + PORT_MAINSTATUS) & 0x40 ) {
+ Log_Warning("FDD", "FDD_int_SendByte: DIO set, is this ok?");
+ }
if( now() < end )
{
if( now() < end )
{
@@
-731,9
+735,13
@@
int FDD_int_GetByte(int base, Uint8 *value)
{
tTime end = now() + 1000; // 1s
{
tTime end = now() + 1000; // 1s
- while( (inb(base + PORT_MAINSTATUS) & 0x
d0) != 0xd
0 && now() < end )
+ while( (inb(base + PORT_MAINSTATUS) & 0x
80) != 0x8
0 && now() < end )
Threads_Yield();
Threads_Yield();
+ if( !(inb(base + PORT_MAINSTATUS) & 0x40) ) {
+ Log_Warning("FDD", "FDD_int_GetByte: DIO unset, is this ok?");
+ }
+
if( now() < end )
{
Uint8 tmp = inb(base + PORT_DATA);
if( now() < end )
{
Uint8 tmp = inb(base + PORT_DATA);
UCC
git Repository :: git.ucc.asn.au