1 /*  extipl.h -  header for extipl modules
2  *		Auther:	KIMURA Takamiti<takamiti@tsden.org>
3  *
4  *  $Id: extipl.h,v 1.7 2002/03/25 13:48:52 takamiti Exp $
5  */
6 
7 #define VERSION			"5.04"
8 #define DATE			"2002/03/26"
9 
10 #define SECTOR_SIZE		512
11 #define IPL_SIZE		446
12 #define TABLE_OFFSET		446
13 #define NR_PARTITION		4
14 #define TBL_ENTRY_SIZE		16
15 #define TABLE_SIZE		(NR_PARTITION * TBL_ENTRY_SIZE)
16 #define IPL_MAGIC_POS		510
17 #define IPL_MAGIC		0xaa55
18 
19 #define LBUF_SIZE		256
20 
21 #define EXTDOS_PART		0x05
22 #define EXTLINUX_PART		0x85
23 #define EXTDOSLBA_PART		0x0f
24 #define is_extpart(n)		((n)==EXTDOS_PART || (n)==EXTLINUX_PART || (n)==EXTDOSLBA_PART)
25 
26 #define GEMINI_BLKLEN		18
27 #define GEMINI_SIZE		(GEMINI_BLKLEN * SECTOR_SIZE)
28 #define GEMINI_CODELN		(GEMINI_SIZE - SECTOR_SIZE)
29 #define IPLNAME_LEN		14
30 #define DIG_LIMIT		16
31 
32 #define Boot_Maybe		0x00
33 #define Boot_Enable		0x01
34 #define Boot_SwapDrv		0x02
35 #define Boot_Disable		0x80
36 
37 #define ctrl(c)			((c) - 0x40)
38 #define between(a, l, u)	((unsigned short)((a)-(l)) <= ((u)-(l)))
39 #define bell()			printf("\007")
40 
41 typedef unsigned char byte;
42 typedef unsigned long long ul_long;
43 
44 typedef struct hdadr_s {
45 	byte  head;
46 	byte  sect;
47 	byte  cyl;
48     } hdadr_s;
49 
50 typedef struct partition_s {
51 	byte	       bootind;
52 	hdadr_s        start_chs;
53 	byte	       sysind;
54 	hdadr_s        end_chs;
55 	unsigned long  sector_offset;
56 	unsigned long  nr_sector;
57     } partition_s;
58 
59 typedef struct offset_s {
60 	hdadr_s	chs;
61 	ul_long	lba;
62     } offset_s;
63 
64 typedef struct extinfo_s {
65 	struct offset_s	    offset;
66 	struct partition_s  table[4];
67 	struct extinfo_s    *next;
68     } extinfo_s;
69 
70 typedef struct sysident_s {
71 	int   id;
72 	int   bootable;
73 	char  *name;
74     } sysident_s;
75 
76 typedef struct incode_s {
77 	char  *code;
78 	int   len;
79     } incode_s;
80 
81 typedef struct inneripl_s {
82 	char		*iplname;
83 	int		nr_part;
84 	char		*note;
85 	struct incode_s hd_code[2];
86 	struct incode_s fd_code[2];
87     } internslipl_s;
88 
89 /* end of extipl.h */
90