
There is important information about booting non-ack images in docs/UPDATING. ack/aout-format images can't be built any more, and booting clang/ELF-format ones is a little different. Updating to the new boot monitor is recommended. Changes in this commit: . drop boot monitor -> allowing dropping ack support . facility to copy ELF boot files to /boot so that old boot monitor can still boot fairly easily, see UPDATING . no more ack-format libraries -> single-case libraries . some cleanup of OBJECT_FMT, COMPILER_TYPE, etc cases . drop several ack toolchain commands, but not all support commands (e.g. aal is gone but acksize is not yet). . a few libc files moved to netbsd libc dir . new /bin/date as minix date used code in libc/ . test compile fix . harmonize includes . /usr/lib is no longer special: without ack, /usr/lib plays no kind of special bootstrapping role any more and bootstrapping is done exclusively through packages, so releases depend even less on the state of the machine making them now. . rename nbsd_lib* to lib* . reduce mtree
63 lines
2.5 KiB
C
63 lines
2.5 KiB
C
#ifndef _MINIX_BLOCKDRIVER_H
|
|
#define _MINIX_BLOCKDRIVER_H
|
|
|
|
#include <minix/driver.h>
|
|
|
|
typedef int device_id_t;
|
|
typedef int thread_id_t;
|
|
|
|
/* Types supported for the 'type' field of struct blockdriver. */
|
|
typedef enum {
|
|
BLOCKDRIVER_TYPE_DISK, /* handle partition requests */
|
|
BLOCKDRIVER_TYPE_OTHER /* do not handle partition requests */
|
|
} blockdriver_type_t;
|
|
|
|
/* Entry points into the device dependent code of block drivers. */
|
|
struct blockdriver {
|
|
blockdriver_type_t bdr_type;
|
|
_PROTOTYPE( int (*bdr_open), (dev_t minor, int access) );
|
|
_PROTOTYPE( int (*bdr_close), (dev_t minor) );
|
|
_PROTOTYPE( ssize_t (*bdr_transfer), (dev_t minor, int do_write, u64_t pos,
|
|
endpoint_t endpt, iovec_t *iov, unsigned count, int flags) );
|
|
_PROTOTYPE( int (*bdr_ioctl), (dev_t minor, unsigned int request,
|
|
endpoint_t endpt, cp_grant_id_t grant) );
|
|
_PROTOTYPE( void (*bdr_cleanup), (void) );
|
|
_PROTOTYPE( struct device *(*bdr_part), (dev_t minor) );
|
|
_PROTOTYPE( void (*bdr_geometry), (dev_t minor, struct partition *part) );
|
|
_PROTOTYPE( void (*bdr_intr), (unsigned int irqs) );
|
|
_PROTOTYPE( void (*bdr_alarm), (clock_t stamp) );
|
|
_PROTOTYPE( int (*bdr_other), (message *m_ptr) );
|
|
_PROTOTYPE( int (*bdr_device), (dev_t minor, device_id_t *id) );
|
|
};
|
|
|
|
/* Functions defined by libblockdriver. These can be used for both
|
|
* singlethreaded and multithreaded drivers.
|
|
*/
|
|
_PROTOTYPE( void blockdriver_announce, (int type) );
|
|
|
|
#ifndef _BLOCKDRIVER_MT_API
|
|
/* Additional functions for the singlethreaded version. These allow the driver
|
|
* to either use the stock driver_task(), or implement its own message loop.
|
|
* To avoid accidents, these functions are not exposed when minix/driver_mt.h
|
|
* has been included previously.
|
|
*/
|
|
_PROTOTYPE( int blockdriver_receive_mq, (message *m_ptr, int *status_ptr) );
|
|
_PROTOTYPE( void blockdriver_process, (struct blockdriver *dp, message *m_ptr,
|
|
int ipc_status) );
|
|
_PROTOTYPE( void blockdriver_terminate, (void) );
|
|
_PROTOTYPE( void blockdriver_task, (struct blockdriver *bdp) );
|
|
_PROTOTYPE( int blockdriver_mq_queue, (message *m_ptr, int status) );
|
|
#endif /* !_BLOCKDRIVER_MT_API */
|
|
|
|
/* Parameters for the disk drive. */
|
|
#define SECTOR_SIZE 512 /* physical sector size in bytes */
|
|
#define SECTOR_SHIFT 9 /* for division */
|
|
#define SECTOR_MASK 511 /* and remainder */
|
|
|
|
#define CD_SECTOR_SIZE 2048 /* sector size of a CD-ROM in bytes */
|
|
|
|
/* Size of the DMA buffer buffer in bytes. */
|
|
#define DMA_BUF_SIZE (DMA_SECTORS * SECTOR_SIZE)
|
|
|
|
#endif /* _MINIX_BLOCKDRIVER_H */
|