source: bootcd/isolinux/syslinux-6.03/core/include/disk.h

Last change on this file was e16e8f2, checked in by Edwin Eefting <edwin@datux.nl>, 3 years ago

bootstuff

  • Property mode set to 100644
File size: 1.0 KB
Line 
1#ifndef DISK_H
2#define DISK_H
3
4#include <stddef.h>
5#include <stdint.h>
6#include <stdbool.h>
7#include <core.h>
8
9typedef uint64_t sector_t;
10typedef uint64_t block_t;
11
12struct bios_disk_private {
13        com32sys_t *regs;
14};
15
16/*
17 * struct disk: contains the information about a specific disk and also
18 * contains the I/O function.
19 */
20struct disk {
21    void *private;      /* Firmware-private disk info */
22    unsigned int disk_number;   /* in BIOS style */
23    unsigned int sector_size;   /* gener512B or 2048B */
24    unsigned int sector_shift;
25    unsigned int maxtransfer;   /* Max sectors per transfer */
26   
27    unsigned int h, s;          /* CHS geometry */
28    unsigned int secpercyl;     /* h*s */
29    unsigned int _pad;
30
31    sector_t part_start;   /* the start address of this partition(in sectors) */
32
33    int (*rdwr_sectors)(struct disk *, void *, sector_t, size_t, bool);
34};
35
36extern void read_sectors(char *, sector_t, int);
37extern void getoneblk(struct disk *, char *, block_t, int);
38
39/* diskio.c */
40struct disk *bios_disk_init(void *);
41struct device *device_init(void *);
42
43#endif /* DISK_H */
Note: See TracBrowser for help on using the repository browser.