search for: lbacnt

Displaying 15 results from an estimated 15 matches for "lbacnt".

2013 Sep 06
1
[PATCH 2/2] com32/disk: Improve flow at disk_write_sectors and disk_read_sectors.
...nfo *const diskinfo, + com32sys_t *inreg, uint64_t lba, uint8_t count) +{ + unsigned int c, h, s, t; + void *buf; + + buf = lmalloc(count * diskinfo->bps); + if (!buf) + return NULL; + + /* + * if we passed lba + count check and we get here, that means that + * lbacnt was calculated from chs geometry (or faked from 1/1/1), thus + * 32bits are perfectly enough and lbacnt corresponds to cylinder + * boundary + */ + s = lba % diskinfo->spt; + t = lba / diskinfo->spt; + h = t % diskinfo->head; + c = t / diskinfo->head; + + inre...
2013 Sep 06
1
[PATCH 2/2 v2] com32/disk: Improve flow at disk_write_sectors and disk_read_sectors.
...fo *const diskinfo, + com32sys_t *inreg, uint64_t lba, uint8_t count) +{ + unsigned int c, h, s, t; + void *buf; + + buf = lmalloc(count * diskinfo->bps); + if (!buf) + return NULL; + + /* + * if we passed lba + count check and we get here, that means that + * lbacnt was calculated from chs geometry (or faked from 1/1/1), thus + * 32bits are perfectly enough and lbacnt corresponds to cylinder + * boundary + */ + s = lba % diskinfo->spt; + t = lba / diskinfo->spt; + h = t % diskinfo->head; + c = t / diskinfo->head; + + inre...
2013 Sep 17
1
[PATCH 2/4 v3] com32/disk: Code cleanup at disk_write_sectors and disk_read_sectors.
...skinfo, com32sys_t *inreg, + uint64_t lba, uint8_t count, uint8_t op_code) +{ + unsigned int c, h, s, t; + void *buf; + + buf = lmalloc(count * diskinfo->bps); + if (!buf) + return NULL; + + /* + * if we passed lba + count check and we get here, that means that + * lbacnt was calculated from chs geometry (or faked from 1/1/1), thus + * 32bits are perfectly enough and lbacnt corresponds to cylinder + * boundary + */ + s = lba % diskinfo->spt; + t = lba / diskinfo->spt; + h = t % diskinfo->head; + c = t / diskinfo->head; + + inre...
2015 Sep 24
0
[PATCH] com32/disk: add UEFI support
...UX_DISK_H_ #include <com32.h> #include <stdint.h> @@ -50,15 +51,24 @@ enum disk_op_codes { struct disk_info { int disk; - int ebios; /* EBIOS supported on this disk */ - int cbios; /* CHS geometry is valid */ - uint32_t bps; /* bytes per sector */ - uint64_t lbacnt; /* total amount of sectors */ + uint32_t bps; /* bytes per sector */ + uint64_t lbacnt; /* total amount of sectors */ uint32_t cyl; uint32_t head; uint32_t spt; + union { + struct { /* BIOS-specific information */ + int ebios; /* EBIOS supported on thi...
2013 Sep 06
2
[PATCH 1/2] com32/lib/: Avoid unneeded allocation.
...s == 1 */ if (diskinfo->ebios) { + eparam = lmalloc(sizeof *eparam); + if (!eparam) + return -1; + memset(&inreg, 0, sizeof inreg); inreg.eax.b[1] = 0x48; inreg.edx.b[0] = disk; @@ -153,7 +153,8 @@ int disk_get_params(int disk, struct disk_info *const diskinfo) diskinfo->lbacnt = diskinfo->cyl * diskinfo->head * diskinfo->spt; out: - lfree(eparam); + if (eparam) + lfree(eparam); return rv; } -- 1.7.2.5
2010 Oct 13
3
[syslinux:disklib] disklib: make CHS calculation match core/fs/diskio.c
On 10/13/2010 08:36 AM, syslinux-bot for Michal Soltys wrote: > Commit-ID: 9c8db7560e2dc83d1191bb2f90b4d4d0ae3d37d6 > Gitweb: http://syslinux.zytor.com/commit/9c8db7560e2dc83d1191bb2f90b4d4d0ae3d37d6 > Author: Michal Soltys <soltys at ziu.info> > AuthorDate: Wed, 13 Oct 2010 10:57:36 +0200 > Committer: Michal Soltys <soltys at ziu.info> > CommitDate: Wed, 13
2014 Jun 29
10
[PATCH 0/6] chain.c32 patches
This small set fixes few bugs, improves gpt handling (under buggy conditions) and implements strict flag with more fine grained control which should fix issues with sanity checks against disk sizes. If this set is allright I'd want to do what I mentioned in older discussion with Ady - backport missing patches from 6.x to 5.x and 4.x so all versions have up to date chain version. Michal
2014 Jun 29
0
[PATCH 1/6] chain/partiter: fix and improve gpt handling in buggy cases
...tatic void try_gpt_we(const char *str, int sec) +{ + if (sec) + error(str); + else + warn(str); +} + +static struct disk_gpt_header *try_gpt_hdr(const struct disk_info *di, int sec) +{ + const char *desc = sec ? "backup" : "primary"; + uint64_t gpt_cur = sec ? di->lbacnt - 1 : 1; + struct disk_gpt_header *gpth; + char errbuf[64]; + + gpth = disk_read_sectors(di, gpt_cur, 1); + if (!gpth) { + sprintf(errbuf, "Unable to read %s GPT header.", desc); + try_gpt_we(errbuf, sec); + return NULL; + } + if(!valid_crc_hdr(gpth)) { + sprintf(errbuf,...
2015 Jul 22
0
[PULL 1/8] Move partiter from com32/chain to com32/lib/syslinux
...e(iter->data); -} - -/* pi_ctor() - common/raw iterator initialization */ -static int pi_ctor(struct part_iter *iter, - const struct disk_info *di, int flags -) -{ - memcpy(&iter->di, di, sizeof *di); - iter->flags = flags; - iter->index0 = -1; - iter->length = di->lbacnt; - - iter->type = typeraw; - return 0; -} - -/* pi_dos_ctor() - MBR/EBR iterator specific initialization */ -static int pi_dos_ctor(struct part_iter *iter, - const struct disk_info *di, int flags, - const struct disk_dos_mbr *mbr -) -{ - if (pi_ctor(iter, di, flags)) - return -1; - -...
2012 Aug 20
13
[PATCH 00/12] Multidisk support
Hello, the following patches should get multidisk access working. The syntax accepted is the following: (hdx,y)/path/to/file where x is the disk number and start at 0 and the y is the partition number starting at 1. So (hd0,1) is the first partition of the first disk. the other accepted syntax is using MBR's 32 bits disk signature so for example: (mbr:0x12345678,2)/foo/bar would address
2013 Oct 18
0
[RFC/PATCH 1/3] Move partiter from com32/chain to com32/lib/syslinux
...e(iter->data); -} - -/* pi_ctor() - common/raw iterator initialization */ -static int pi_ctor(struct part_iter *iter, - const struct disk_info *di, int flags -) -{ - memcpy(&iter->di, di, sizeof *di); - iter->flags = flags; - iter->index0 = -1; - iter->length = di->lbacnt; - - iter->type = typeraw; - return 0; -} - -/* pi_dos_ctor() - MBR/EBR iterator specific initialization */ -static int pi_dos_ctor(struct part_iter *iter, - const struct disk_info *di, int flags, - const struct disk_dos_mbr *mbr -) -{ - if (pi_ctor(iter, di, flags)) - return -1; - -...
2013 Sep 17
0
[PATCH 1/2] com32/lib/: Avoid unneeded allocation.
...; + if (!eparam) > + return -1; > + There's trailing whitespace here. > memset(&inreg, 0, sizeof inreg); > inreg.eax.b[1] = 0x48; > inreg.edx.b[0] = disk; > @@ -153,7 +153,8 @@ int disk_get_params(int disk, struct disk_info *const diskinfo) > diskinfo->lbacnt = diskinfo->cyl * diskinfo->head * diskinfo->spt; > > out: > - lfree(eparam); > + if (eparam) > + lfree(eparam); > return rv; > } You actually don't need to check for 'eparam' being NULL, lfree() can handle being called with a NULL pointer....
2012 Nov 06
50
chain.c32 (and partiter) updates v2
This is a bit updated set of chain.c32 changes that simplifies a few things (and in partiter part), fixes few minor issues and adds a few new features. Details are in the following commits, below is the summary and pull details at the end. Shao - any chance to peek over them ? Most of those are relatively simple changes and well tested, though of course something might have slipped my attention.
2012 Jun 26
2
[GIT PULL] elflink bug fixes
...f (outreg.eflags.l & EFLAGS_CF) { + rv = diskinfo->ebios ? 0 : -1; + goto out; + } diskinfo->spt = 0x3f & outreg.ecx.b[0]; diskinfo->head = 1 + outreg.edx.b[1]; @@ -145,7 +152,9 @@ int disk_get_params(int disk, struct disk_info *const diskinfo) if (!diskinfo->lbacnt) diskinfo->lbacnt = diskinfo->cyl * diskinfo->head * diskinfo->spt; - return 0; +out: + lfree(eparam); + return rv; } /** @@ -163,17 +172,26 @@ void *disk_read_sectors(const struct disk_info *const diskinfo, uint64_t lba, uint8_t count) { com32sys_t inreg; -...
2015 Jul 22
13
[PULL 0/8] MultiFS suppport for BIOS and EFI
So last week I was wondering if XFS was still working -- even with its last on-disk structure changes -- and it _suprisingly_ worked as expected. Right, now I can finally get rid of GRUB and use Syslinux to boot my Linux on EFI from a rootfs with xfs. Shit, I have two partitions (the first one being the required ESP) so there is no way to access the other partitions since because Syslinux does not