Floppy driver problems
Posted: Thu Aug 31, 2006 5:35 am
Hi,
I am trying to write a floppy driver, and I have come accross a problem. I am trying to memcpy the disk parameters from their location in the memory, but I get a parse error when I try to compile it. Here's the code:
I have tried many variations, but I still can't get it to compile... If I comment out the last line, it does compile, but then the driver won't work... The error is:
-Stephen
I am trying to write a floppy driver, and I have come accross a problem. I am trying to memcpy the disk parameters from their location in the memory, but I get a parse error when I try to compile it. Here's the code:
Code: Select all
#define DISK_PARAMETER_ADDRESS 0x000fefc7
//location where disk parameters are stored by bios
typedef struct{
unsigned char steprate_headunload;
unsigned char headload_ndma;
unsigned char motor_delay_off; /*specified in clock ticks*/
unsigned char bytes_per_sector;
unsigned char sectors_per_track;
unsigned char gap_length;
unsigned char data_length; /*used only when bytes per sector == 0*/
unsigned char format_gap_length;
unsigned char filler;
unsigned char head_settle_time; /*specified in milliseconds*/
unsigned char motor_start_time; /*specified in 1/8 seconds*/
}floppy_parameters;
floppy_parameters floppy_disk; //declare variable of floppy_parameters type
memcpy(&floppy_disk, (unsigned char *)DISK_PARAMETER_ADDRESS, sizeof(floppy_parameters));
// Copy parameters (doesn't work)
Code: Select all
In file included from floppy.c:4:
include/floppy.h:26: error: parse error before '&' token