minix/include/arch/earm/include/partition.h
Ben Gras a9db0ea184 x86 hd image creator
A script that creates a HD image ready to be booted by an x86
emulator, ready to work in a crossbuild environment.

It's really just for qemu/kvm as there's no boot code in
the MBR and no bootloader installed so we rely on the in-kvm
multiboot implementation for now. This is very convenient for
passing args too.

To minimize reliance on external tools, we use the Minix
'partition' utility to write the partition table of the HD
image, which therefore has to be compiled natively.

	. new script releasetools/x86_hdimage.sh
	. natively compile minix 'partition' utility
	. make <machine/partition.h> 64-bit safe for it

Change-Id: If645b4691536752271e0b8a8ed59a34f248dace4
2013-09-25 19:30:22 +02:00

28 lines
1 KiB
C

/* Description of entry in partition table. */
#ifndef _PARTITION_H
#define _PARTITION_H
#include <stdint.h>
struct part_entry {
uint8_t bootind; /* boot indicator 0/ACTIVE_FLAG */
uint8_t start_head; /* head value for first sector */
uint8_t start_sec; /* sector value + cyl bits for first sector */
uint8_t start_cyl; /* track value for first sector */
uint8_t sysind; /* system indicator */
uint8_t last_head; /* head value for last sector */
uint8_t last_sec; /* sector value + cyl bits for last sector */
uint8_t last_cyl; /* track value for last sector */
uint32_t lowsec; /* logical first sector */
uint32_t size; /* size of partition in sectors */
};
#define ACTIVE_FLAG 0x80 /* value for active in bootind field (hd0) */
#define NR_PARTITIONS 4 /* number of entries in partition table */
#define PART_TABLE_OFF 0x1BE /* offset of partition table in boot sector */
/* Partition types. */
#define NO_PART 0x00 /* unused entry */
#define MINIX_PART 0x81 /* Minix partition type */
#endif /* _PARTITION_H */