summaryrefslogtreecommitdiffstats
path: root/extlinux
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-05-19 16:30:09 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-05-19 16:30:09 -0700
commit0fa4369624b4637a7e36ed22e89a759031f08327 (patch)
tree4aa1cf5c87d36153cee3c727d5f77498c0042983 /extlinux
parentc9ad266f64f9ee81a859bdf70c1190ee0cc1bc19 (diff)
downloadsyslinux-0fa4369624b4637a7e36ed22e89a759031f08327.tar.gz
syslinux-0fa4369624b4637a7e36ed22e89a759031f08327.tar.xz
syslinux-0fa4369624b4637a7e36ed22e89a759031f08327.zip
FAT: change DOS installer to EXE; additional 32K limit fixes
Additional fixes for the 32K limits in the installers. In the case of the DOS installer, that means changing it from COM format to EXE format (since COM format has a 63K hard limit); retain the name syslinux.com for user compatibility, though (DOS doesn't care what the extension except for pathname search; if it finds an MZ EXE header it will use it.) With the change to EXE means having to handle more than one segment. Since we don't have a real DOS compiler we have to wing it a bit. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'extlinux')
-rw-r--r--extlinux/main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/extlinux/main.c b/extlinux/main.c
index c4ccd538..79123c9d 100644
--- a/extlinux/main.c
+++ b/extlinux/main.c
@@ -233,7 +233,7 @@ sectmap(int fd, uint32_t *sectors, int nsectors)
return -1;
/* Number of sectors per block */
- blksize >>= SECTOR_SHIFT;
+ blksize >>= SECTOR_BITS;
nblk = 0;
while ( nsectors ) {
@@ -336,7 +336,7 @@ get_geometry(int devfd, uint64_t totalbytes, struct hd_geometry *geo)
geo->heads = opt.heads ?: 64;
geo->sectors = opt.sectors ?: 32;
- geo->cylinders = totalbytes/(geo->heads*geo->sectors << SECTOR_SHIFT);
+ geo->cylinders = totalbytes/(geo->heads*geo->sectors << SECTOR_BITS);
geo->start = 0;
if ( !opt.sectors && !opt.heads )
@@ -386,7 +386,7 @@ patch_file_and_bootblock(int fd, int dirfd, int devfd)
bs = (struct boot_sector *)boot_block;
- totalsectors = totalbytes >> SECTOR_SHIFT;
+ totalsectors = totalbytes >> SECTOR_BITS;
if ( totalsectors >= 65536 ) {
set_16(&bs->bsSectors, 0);
} else {
@@ -410,7 +410,7 @@ patch_file_and_bootblock(int fd, int dirfd, int devfd)
/* Construct the boot file */
dprintf("directory inode = %lu\n", (unsigned long) dirst.st_ino);
- nsect = (boot_image_len+SECTOR_SIZE-1) >> SECTOR_SHIFT;
+ nsect = (boot_image_len+SECTOR_SIZE-1) >> SECTOR_BITS;
nsect += 2; /* Two sectors for the ADV */
sectp = alloca(sizeof(uint32_t)*nsect);
if ( sectmap(fd, sectp, nsect) ) {