Merge branch 'lwip' into elflink
[syslinux.git] / libinstaller / syslinux.h
blobf60a066e5a91c9e434e4f033aabb0d14bc0ab06a
1 /* ----------------------------------------------------------------------- *
3 * Copyright 1998-2008 H. Peter Anvin - All Rights Reserved
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8 * Boston MA 02111-1307, USA; either version 2 of the License, or
9 * (at your option) any later version; incorporated herein by reference.
11 * ----------------------------------------------------------------------- */
13 #ifndef SYSLINUX_H
14 #define SYSLINUX_H
16 #include <inttypes.h>
17 #include "advconst.h"
18 #include "setadv.h"
20 /* The standard boot sector and ldlinux image */
21 extern unsigned char syslinux_bootsect[];
22 extern const unsigned int syslinux_bootsect_len;
23 extern const int syslinux_bootsect_mtime;
25 extern unsigned char syslinux_ldlinux[];
26 extern const unsigned int syslinux_ldlinux_len;
27 extern const int syslinux_ldlinux_mtime;
29 extern unsigned char syslinux_ldlinuxc32[];
30 extern const unsigned int syslinux_ldlinuxc32_len;
32 #define boot_sector syslinux_bootsect
33 #define boot_sector_len syslinux_bootsect_len
34 #define boot_image syslinux_ldlinux
35 #define boot_image_len syslinux_ldlinux_len
37 extern unsigned char syslinux_mbr[];
38 extern const unsigned int syslinux_mbr_len;
39 extern const int syslinux_mbr_mtime;
41 /* Sector size assumptions... */
42 #define SECTOR_SHIFT 9
43 #define SECTOR_SIZE (1 << SECTOR_SHIFT)
45 /* This takes a boot sector and merges in the syslinux fields */
46 void syslinux_make_bootsect(void *bs, int fs_type);
48 /* Check to see that what we got was indeed an MS-DOS boot sector/superblock */
49 const char *syslinux_check_bootsect(const void *bs, int *fs_type);
51 /* This patches the boot sector and ldlinux.sys based on a sector map */
52 typedef uint64_t sector_t;
53 int syslinux_patch(const sector_t *sectors, int nsectors,
54 int stupid, int raid_mode,
55 const char *subdir, const char *subvol);
57 #endif