implement handling of to specified disks > 0 in the command codes as only
1 disk (disk 0) is supported
This commit is contained in:
parent
77b370f20b
commit
298f0c3816
|
|
@ -26,7 +26,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Id: wdc_if_disk.h,v 1.10 2013/05/04 15:40:14 olivleh1 Exp $
|
* $Id: wdc_if_disk.h,v 1.11 2013/05/09 12:30:25 olivleh1 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef WDC_IF_DISK_H_
|
#ifndef WDC_IF_DISK_H_
|
||||||
|
|
@ -56,6 +56,8 @@ t_drv_write_block drv_write_block;
|
||||||
t_drv_read_multiblock drv_read_multiblock;
|
t_drv_read_multiblock drv_read_multiblock;
|
||||||
t_drv_write_multiblock drv_write_multiblock;
|
t_drv_write_multiblock drv_write_multiblock;
|
||||||
|
|
||||||
|
#define wdc_number_of_disks() 1
|
||||||
|
|
||||||
#define WDC_BLOCKLEN 512
|
#define WDC_BLOCKLEN 512
|
||||||
|
|
||||||
#endif /* WDC_IF_DISK_H_ */
|
#endif /* WDC_IF_DISK_H_ */
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Id: wdc_if_p8000.c,v 1.16 2013/05/04 15:40:15 olivleh1 Exp $
|
* $Id: wdc_if_p8000.c,v 1.17 2013/05/09 12:30:25 olivleh1 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "wdc_config.h"
|
#include "wdc_config.h"
|
||||||
|
|
@ -38,11 +38,11 @@
|
||||||
|
|
||||||
void wdc_wait_for_reset ()
|
void wdc_wait_for_reset ()
|
||||||
{
|
{
|
||||||
while ( isset_info_reset() ) {
|
port_data_set ( DATA_CLEAR );
|
||||||
port_data_set ( DATA_CLEAR );
|
port_info_set ( INFO_CLEAR );
|
||||||
port_info_set ( INFO_CLEAR );
|
wdc_set_initialized ( 1 );
|
||||||
wdc_set_initialized ( 1 );
|
|
||||||
}
|
while ( isset_info_reset() ) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t wdc_read_data_from_p8k ( uint8_t *buffer, uint16_t count, uint8_t wdc_status )
|
uint8_t wdc_read_data_from_p8k ( uint8_t *buffer, uint16_t count, uint8_t wdc_status )
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Id: wdc_main.c,v 1.35 2013/05/09 00:16:04 olivleh1 Exp $
|
* $Id: wdc_main.c,v 1.36 2013/05/09 12:30:25 olivleh1 Exp $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -165,6 +165,22 @@ main ( void )
|
||||||
} else {
|
} else {
|
||||||
wdc_send_error();
|
wdc_send_error();
|
||||||
}
|
}
|
||||||
|
/* if the specified drive exceeds the number of drives, no drive commands are allowed */
|
||||||
|
} else if ( cmd_buffer[1] >= wdc_number_of_disks()
|
||||||
|
&& ( cmd_buffer[0] == CMD_RD_SECTOR
|
||||||
|
|| cmd_buffer[0] == CMD_FMTRD_TRACK
|
||||||
|
|| cmd_buffer[0] == CMD_RD_BLOCK
|
||||||
|
|| cmd_buffer[0] == CMD_WR_BLOCK
|
||||||
|
|| cmd_buffer[0] == CMD_FMTBTT_TRACK
|
||||||
|
|| cmd_buffer[0] == CMD_VER_TRACK
|
||||||
|
|| ( cmd_buffer[0] == CMD_RD_BTTAB && !wdc_get_btt_cleared() )
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
if ( cmd_buffer[0] == CMD_RD_BTTAB ) {
|
||||||
|
wdc_send_errorcode ( ERR_BTT_INVALID );
|
||||||
|
} else {
|
||||||
|
wdc_send_errorcode ( ERR_DRIVE_NOT_READY );
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
switch ( cmd_buffer[0] ) {
|
switch ( cmd_buffer[0] ) {
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Id: wdc_main.h,v 1.14 2013/05/04 15:40:15 olivleh1 Exp $
|
* $Id: wdc_main.h,v 1.15 2013/05/09 12:30:25 olivleh1 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MAIN_H_
|
#ifndef MAIN_H_
|
||||||
|
|
@ -59,8 +59,10 @@
|
||||||
#define CMD_ST_PARBTT 0xc2 /* store Parameter block and BTT on hard disk */
|
#define CMD_ST_PARBTT 0xc2 /* store Parameter block and BTT on hard disk */
|
||||||
|
|
||||||
#define ERR_STANDARD 0x01
|
#define ERR_STANDARD 0x01
|
||||||
|
#define ERR_DRIVE_NOT_READY 0x03
|
||||||
#define ERR_SECT_N_ON_SURFACE 0x0A
|
#define ERR_SECT_N_ON_SURFACE 0x0A
|
||||||
#define ERR_BTT_FULL 0x16
|
#define ERR_BTT_FULL 0x16
|
||||||
|
#define ERR_BTT_INVALID 0x18
|
||||||
#define ERR_NO_DRIVE_READY 0x27
|
#define ERR_NO_DRIVE_READY 0x27
|
||||||
#define ERR_CYL0_NOT_READABLE 0x31
|
#define ERR_CYL0_NOT_READABLE 0x31
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Id: wdc_par.c,v 1.9 2013/05/04 15:40:15 olivleh1 Exp $
|
* $Id: wdc_par.c,v 1.10 2013/05/09 12:30:25 olivleh1 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <avr/pgmspace.h>
|
#include <avr/pgmspace.h>
|
||||||
|
|
@ -104,6 +104,7 @@ const uint8_t
|
||||||
|
|
||||||
uint8_t valid_disk = 1;
|
uint8_t valid_disk = 1;
|
||||||
uint8_t initialized;
|
uint8_t initialized;
|
||||||
|
uint8_t btt_cleared = 0;
|
||||||
|
|
||||||
void wdc_read_par_table ( uint8_t *buffer, uint16_t count )
|
void wdc_read_par_table ( uint8_t *buffer, uint16_t count )
|
||||||
{
|
{
|
||||||
|
|
@ -146,6 +147,7 @@ void wdc_del_wdc_btt ()
|
||||||
}
|
}
|
||||||
|
|
||||||
par_table[122 + POS_PAR_WDC_BTT] = 0xff;
|
par_table[122 + POS_PAR_WDC_BTT] = 0xff;
|
||||||
|
btt_cleared = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wdc_read_wdc_btt ( uint8_t *buffer, uint16_t count )
|
void wdc_read_wdc_btt ( uint8_t *buffer, uint16_t count )
|
||||||
|
|
@ -277,4 +279,9 @@ void wdc_set_initialized ( uint8_t num )
|
||||||
uint8_t wdc_get_initialized ()
|
uint8_t wdc_get_initialized ()
|
||||||
{
|
{
|
||||||
return initialized;
|
return initialized;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t wdc_get_btt_cleared ()
|
||||||
|
{
|
||||||
|
return btt_cleared;
|
||||||
}
|
}
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Id: wdc_par.h,v 1.6 2013/05/04 15:40:15 olivleh1 Exp $
|
* $Id: wdc_par.h,v 1.7 2013/05/09 12:30:25 olivleh1 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef WDC_PAR_H_
|
#ifndef WDC_PAR_H_
|
||||||
|
|
@ -52,6 +52,7 @@ extern void wdc_set_no_disk ();
|
||||||
extern uint8_t wdc_get_num_of_drvs ();
|
extern uint8_t wdc_get_num_of_drvs ();
|
||||||
extern void wdc_set_initialized ( uint8_t num );
|
extern void wdc_set_initialized ( uint8_t num );
|
||||||
extern uint8_t wdc_get_initialized ();
|
extern uint8_t wdc_get_initialized ();
|
||||||
|
extern uint8_t wdc_get_btt_cleared ();
|
||||||
|
|
||||||
#define POS_PAR_VERSION 0 /* defines at which position in the PAR table the WDC version string starts */
|
#define POS_PAR_VERSION 0 /* defines at which position in the PAR table the WDC version string starts */
|
||||||
#define POS_PAR_WDC_PAR 8 /* defines at which position in the PAR table the WDC parameter section starts */
|
#define POS_PAR_WDC_PAR 8 /* defines at which position in the PAR table the WDC parameter section starts */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue