profile/ivi/syslinux.git
14 years agocom32/chain: remove remains of SECTOR
Michal Soltys [Wed, 13 Oct 2010 21:32:38 +0000 (23:32 +0200)]
com32/chain: remove remains of SECTOR

All chain related code no longer depends on hardcoded sector
size.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agocom32/chain/partiter.c,h: updates
Michal Soltys [Wed, 13 Oct 2010 21:00:56 +0000 (23:00 +0200)]
com32/chain/partiter.c,h: updates

- lbacnt field in disklib's diskinfo allows for more strict sanity
  checks
- hardcoded SECTOR is no longer used - we use diskinfo's bps value now
- pi_begin() does additional sanity checks on header values, and allows
  using secondary gpt partition list, if crc of the primary one is
  invalid

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agoMerge branch 'disklibdev' into chaindev
Michal Soltys [Wed, 13 Oct 2010 18:50:47 +0000 (20:50 +0200)]
Merge branch 'disklibdev' into chaindev

14 years agodisklib: make CHS calculation match core/fs/diskio.c
Michal Soltys [Wed, 13 Oct 2010 08:57:36 +0000 (10:57 +0200)]
disklib: make CHS calculation match core/fs/diskio.c

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agoMerge branch 'disklibdev' into chaindev
Michal Soltys [Mon, 11 Oct 2010 22:39:21 +0000 (00:39 +0200)]
Merge branch 'disklibdev' into chaindev

14 years agodisklib: updates to params/read/write functions
Michal Soltys [Sat, 9 Oct 2010 21:55:50 +0000 (23:55 +0200)]
disklib: updates to params/read/write functions

disk_get_params():

Don't bail out if we fail int13h/48h call in ebios == 1 case. Regular
CHS might still be enough.

disk_read_sectors(), disk_write_sectors():

We don't need separate cases for valid and invalid cbios with the data
prepared by the current disk_get_params() function.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agoMerge remote branch 'origin/disklib' into disklibdev
Michal Soltys [Mon, 11 Oct 2010 22:36:58 +0000 (00:36 +0200)]
Merge remote branch 'origin/disklib' into disklibdev

14 years agoMerge branch 'master' into disklib
H. Peter Anvin [Fri, 8 Oct 2010 21:02:33 +0000 (14:02 -0700)]
Merge branch 'master' into disklib

14 years agoMerge remote branch 'genec/rosh_for_hpa' syslinux-4.03-pre4
H. Peter Anvin [Fri, 8 Oct 2010 20:46:26 +0000 (13:46 -0700)]
Merge remote branch 'genec/rosh_for_hpa'

14 years agocom32/chain: move partition entries' mangling to mangle.c
Michal Soltys [Tue, 5 Oct 2010 21:54:04 +0000 (23:54 +0200)]
com32/chain: move partition entries' mangling to mangle.c

All functions related to partition entries' mangling has been moved
to mangle.c, including appropriate renames:

pentry_mangle() -> manglepe_mbrchshide()
pem_setchs() -> mpe_setchs()
pem_sethide() -> mpe_sethide()

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agocom32/chain: allow service-only runs
Michal Soltys [Tue, 5 Oct 2010 21:27:03 +0000 (23:27 +0200)]
com32/chain: allow service-only runs

This patch introduces small feature, allowing so called "service-only"
runs - where the chain modules does everything as instructed, but
otherwise doesn't perform actual chainloading.

This is useful for 'mbrchs', '[un]hide[all]' and 'setbpb'+'save'
options, making possible adjustments to partition/boot sector values on
any disk/partition.

See 'chain' option in doc/chain.txt for more details.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agocom32/chain: fix condition in pentry_mangle()
Michal Soltys [Tue, 5 Oct 2010 21:14:14 +0000 (23:14 +0200)]
com32/chain: fix condition in pentry_mangle()

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agocom32/chain: make raw handover use total sectors info
Michal Soltys [Tue, 5 Oct 2010 18:47:20 +0000 (20:47 +0200)]
com32/chain: make raw handover use total sectors info

With disklib update providing total sectors info, make raw handover
use it (instead of forcing arbitrary number).

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agocom32/chain: Add unhide and unhideall options
Michal Soltys [Thu, 30 Sep 2010 21:21:11 +0000 (23:21 +0200)]
com32/chain: Add unhide and unhideall options

It could be useful to be able to simply unhide partitions. This short
patch adds such functionality.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agocom32/chain: simplify pentry_mangle()
Michal Soltys [Thu, 30 Sep 2010 20:43:31 +0000 (22:43 +0200)]
com32/chain: simplify pentry_mangle()

pentry_mangle() has been simplified and made more readable, using
non-selfkilling iterators, introduced recently.

Further plan is to move 'mbrchs' into separate module (fixit.c32)
providing such feature for all disks (along with some other features,
including [un]hide[all]).

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agocom32/chain: utility's lba2chs update
Michal Soltys [Tue, 28 Sep 2010 17:57:28 +0000 (19:57 +0200)]
com32/chain: utility's lba2chs update

This patch adds 3 modes of operation to lba2chs:

l2c_cnul - strict cylinder mode, using at most the value returned by
13h/48h or 13h/08h

l2c_cadd - allow using 1 cylinder more. Only if cylinders are less than
1024 and total drive's lba size is not on a cylinder boundary.

l2c_max - allow using any cylinder number.

Modes have effect only if CHS geometry (cbios) is valid. chain.c uses
l2c_cadd.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agoMerge branch 'disklib' into chaindev
Michal Soltys [Fri, 8 Oct 2010 10:40:12 +0000 (12:40 +0200)]
Merge branch 'disklib' into chaindev

Conflicts:
com32/modules/chain.c

14 years agodisklib: updates - lbacnt, bps, misc. things
Michal Soltys [Tue, 28 Sep 2010 15:33:25 +0000 (17:33 +0200)]
disklib: updates - lbacnt, bps, misc. things

With this commit, disk_info structure provides additional fields,
namely:

lbacnt - total amount of sectors, either returned by 13h/48h or calculated
from valid (or faked - 1/1/1) geometry

bps - bytes per sector - returned by 13h/48h or equal to SECTOR

disk_get_params() has been adjusted to call int13h/48h to get extended
drive parameters - mentioned lbacnt and bps. We don't use geometry
data returned by 13h/48h, as it can be quite a bit different from
the data returned by 13h/08h.

disk_write_verify_sector() and disk_write_sector() can deal with more
than 1 sector now. Suffix has been renamed to _sectors().

disk_read_sectors() and disk_write_sectors() have been updated to check
if we don't overflow bounce buffer, and don't try to read beyond lbacnt.

All disk.c functions use 'bps' now, instead of hardcoded SECTOR.

struct disk_ebios_dapa - uses packed attribute now.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agoMerge branch 'master' into chaindev
Michal Soltys [Tue, 28 Sep 2010 10:50:32 +0000 (12:50 +0200)]
Merge branch 'master' into chaindev

14 years agocom32/chain/mangle.c: remove useless comment
Michal Soltys [Sat, 25 Sep 2010 11:07:56 +0000 (13:07 +0200)]
com32/chain/mangle.c: remove useless comment

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agocom32/chain/partiter: make iterators not autofree after fin/err
Michal Soltys [Sun, 12 Sep 2010 19:33:05 +0000 (21:33 +0200)]
com32/chain/partiter: make iterators not autofree after fin/err

This patch changes iterator behaviour to not free themselves
automatically after finished iteration or error. This allows
us to be able to always:

- check their status through ->status field
- access last valid data

It will allow simplification of pentry_mangle() function in
further commits.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain/options.c: cosmetics
Michal Soltys [Sat, 28 Aug 2010 14:25:49 +0000 (16:25 +0200)]
chain/options.c: cosmetics

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain/chain.c: add "raw" handover
Michal Soltys [Sat, 28 Aug 2010 14:15:37 +0000 (16:15 +0200)]
chain/chain.c: add "raw" handover

This adds a possibility to create an area resembling proper handover,
when booting mbr of some media. If we have custom/special booting code
always expecting handover, this would allow us to boot it from the 1st
sector as well.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain/utility.c: Adjust lba2chs
Michal Soltys [Sat, 28 Aug 2010 14:13:56 +0000 (16:13 +0200)]
chain/utility.c: Adjust lba2chs

This tiny patch adjusts how lba2chs() deals with unknown geometries.
Instead of returning max values of "typical" geometries, it returns
chs values calculated from them.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain module: bugfixing and cosmetics
Michal Soltys [Sat, 28 Aug 2010 11:20:31 +0000 (13:20 +0200)]
chain module: bugfixing and cosmetics

Bugs:

- one introduced ages ago - find_by_* functions should be tested vs. <0
  for failure
- one introduced by 579f15c7c456c - it accidentally blocked too much
  when testing for ',' in drive/partition option parsing
- one introduced by d4d713c9ccfe0 - sone machines / VMs seem to set
  @40:75 just 1, regardless of amount of fixed disks available

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain module: setbpb changes, bss & bs options, bugfixes
Michal Soltys [Fri, 27 Aug 2010 23:06:13 +0000 (01:06 +0200)]
chain module: setbpb changes, bss & bs options, bugfixes

Generic function detecting BPB type (7 versions) have been added.
set{hid,geo,drv} have been replaced by single setbpb option, using
mentioned function to make more precise decisions what to update where.

Full BSS and BS emulation has been added, also employing BPB detection.

Some logic/flow changes in chain's main(). There was also a bug, in
which backup sector was populated with wrong data.

Appropriate documentation updates.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain module: make option 'save' truly separate
Michal Soltys [Thu, 26 Aug 2010 20:41:41 +0000 (22:41 +0200)]
chain module: make option 'save' truly separate

Previously, option 'save' has been executed as a part of bpb mangling.
This was rather inflexible.

Apart from that, all mangle functions test their respective opt.* options
internally.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain, options: bugfixes, adjustments; big doc update
Michal Soltys [Thu, 26 Aug 2010 07:21:55 +0000 (09:21 +0200)]
chain, options: bugfixes, adjustments; big doc update

- seg='s offset values default to 0 if ommited
- sect='s offset values default to 0x7c00 if ommited
- FDOS's bootsector loaded at 0x1fe0
- drive / partition parsing: bugfix, so lables with ',' are recognized
  properly
- big documentation update

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain: adjust 'mbrchs' calculations, adjust partitier
Michal Soltys [Tue, 24 Aug 2010 23:28:50 +0000 (01:28 +0200)]
chain: adjust 'mbrchs' calculations, adjust partitier

It seems that chs values in extended partitions are expected to provide
absolute positions. Previously these values were calculated directly
from ebr lba values.

Partiter now provides cebr_lba and ebr_lba that hold absolute values
of current and next ebr.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain, partiter, options: bugfix, new options
Michal Soltys [Tue, 24 Aug 2010 17:18:34 +0000 (19:18 +0200)]
chain, partiter, options: bugfix, new options

- small bugfix in partiter.c
- new options: hideall, mbrchs
- new partiter feature - rawindex - counts all (inc. empty) partitions in all
  cases

hideall is expansion of hide, that hides all partitions in a chain, not
only primary ones

mbrchs walks over all partitions and fixes chs values in mbr entries

rawindex keeps count of all partitions, including holes in EBRs

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain, options: fixes, additions
Michal Soltys [Sun, 22 Aug 2010 21:31:55 +0000 (23:31 +0200)]
chain, options: fixes, additions

- add 'bss=' option
- update usage()
- ommited offsets in 'file=' and 'sect=' default to 0x7c00 now
- cosmetics

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agopartiter.c: add stepall modifier; bugfixes + comment changes
Michal Soltys [Sun, 22 Aug 2010 13:36:23 +0000 (15:36 +0200)]
partiter.c: add stepall modifier; bugfixes + comment changes

In certain situations (new features to be added later), it's useful
to be able to step through all partitions in a partition list. This
patch adds necessary functionality.

Adjust chain.c to use new version of partiter.

Also small bugfixes and comment changes.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain.c: Split chain into smaller files
Michal Soltys [Sun, 22 Aug 2010 11:44:01 +0000 (13:44 +0200)]
chain.c: Split chain into smaller files

new file:   chain.h
new file:   common.h
new file:   mangle.c
new file:   mangle.h
new file:   options.c
new file:   options.h
new file:   utility.c
new file:   utility.h

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agopartiter.c: cosmetic changes
Michal Soltys [Sun, 22 Aug 2010 10:29:15 +0000 (12:29 +0200)]
partiter.c: cosmetic changes

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain.c: Improve setdrv option, remove setbpb4/
Michal Soltys [Sat, 21 Aug 2010 20:31:22 +0000 (22:31 +0200)]
chain.c: Improve setdrv option, remove setbpb4/

Option 'setdrv' can autodetect offset now. setbpb4 is removed, as it's
no longer necessary.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain.c: change file/sect/hand area handling logic, add 'hptr' option
Michal Soltys [Sat, 21 Aug 2010 17:33:42 +0000 (19:33 +0200)]
chain.c: change file/sect/hand area handling logic, add 'hptr' option

The logic behind file/sect/hand area handling is more flexible
now. Furthermore, a user can explicitly control where ds:si/ds:bp
should point during chainloading.

Other misc. changes:

- registry setup is more conservative
- 'if' style

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain.c: merge segs= and sect into single option, remove segf
Michal Soltys [Sat, 21 Aug 2010 16:21:17 +0000 (18:21 +0200)]
chain.c: merge segs= and sect into single option, remove segf

There's no need to have separate 'sect' and 'segs='. 'segf' alias of
'seg' can also be removed now.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain.c: option renames
Michal Soltys [Sat, 21 Aug 2010 15:43:48 +0000 (17:43 +0200)]
chain.c: option renames

Renamed some of the options to better fit the whole scheme.
Also adjusted usage().

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain.c: Always use console_ansi_raw(), not only with DEBUG
Michal Soltys [Sat, 21 Aug 2010 14:45:22 +0000 (16:45 +0200)]
chain.c: Always use console_ansi_raw(), not only with DEBUG

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agoMerge branch 'disklib' into chaindev
Michal Soltys [Tue, 28 Sep 2010 07:32:30 +0000 (09:32 +0200)]
Merge branch 'disklib' into chaindev

14 years agocore: fix handling new directory "/" for CONFIG in ISOLINUX and EXTLINUX
Gene Cumm [Fri, 24 Sep 2010 01:51:14 +0000 (21:51 -0400)]
core: fix handling new directory "/" for CONFIG in ISOLINUX and EXTLINUX

14 years agoFix missing option -s in libinstaller syslinux-4.03-pre3
Arwin Vosselman [Thu, 5 Aug 2010 20:17:30 +0000 (22:17 +0200)]
Fix missing option -s in libinstaller

In 'libinstaller/syslxopt.c' on line 71 the "s" (undercast) is missing in:

   const char short_options[] = "t:fid:UuzS:H:rvho:OM:ma";

Adding the 's' there seems to solve our problem.

14 years agopxe: add a "pxeretry" option to deal with 404's in web apps syslinux-4.03-pre2
H. Peter Anvin [Thu, 26 Aug 2010 21:45:53 +0000 (14:45 -0700)]
pxe: add a "pxeretry" option to deal with 404's in web apps

For web downloads, sometimes a mirror site will not be fully synced.
Add an option to retry the open a specific number of times before
giving up.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agochain.c: adjust what ds:si and ds:bp point to after chainloading
Michal Soltys [Thu, 19 Aug 2010 08:50:28 +0000 (10:50 +0200)]
chain.c: adjust what ds:si and ds:bp point to after chainloading

Previously, chain module always set ds:si and ds:bp to handover
area (unless otherwise blocked). This is not necessarily valid in case
when both file and sector are being loaded - here file should receive
pointer to it's [relocated] sector, and it's unlikely interested in
mbr-like handover area at all.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain.c: fixes, adjustments
Michal Soltys [Thu, 19 Aug 2010 06:24:59 +0000 (08:24 +0200)]
chain.c: fixes, adjustments

- update usage()
- add chs2lba()
- update handover code to generate CHS values
- make sure 'write' is never default
- add wait_key()

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain.c: add options, misc varaible renames
Michal Soltys [Wed, 18 Aug 2010 08:53:01 +0000 (10:53 +0200)]
chain.c: add options, misc varaible renames

This patch adds following options:
- setgeo (bpb: set legacy geometry)
- setdrv (bpb: set physical drive number)
- read  (read mbr / bs - previously always attempted)
- write (write bs - for bpb mangling)
- filebpb (also mangle 'kernel' file in memory)
- msdos7 (dos7+ IP is set as required by io.sys)

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain.c: add 'smap' and 'hand' options, update handover code
Michal Soltys [Tue, 17 Aug 2010 12:36:52 +0000 (14:36 +0200)]
chain.c: add 'smap' and 'hand' options, update handover code

'[no]hand' allows explicit control whenever to create handover data

'[no]smap' allows loading bootsector without mapping it during
actual chainloading (meant for upcoming BPB mangling options)

Expanded handover code moved mostly to its own function

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain, partiter: bugfixes
Michal Soltys [Tue, 17 Aug 2010 09:09:45 +0000 (11:09 +0200)]
chain, partiter: bugfixes

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain.c: Don't bruteforce loops detecting fixed drives.
Michal Soltys [Mon, 16 Aug 2010 11:07:12 +0000 (13:07 +0200)]
chain.c: Don't bruteforce loops detecting fixed drives.

Previously chain module looped all possible fixed disks from 0x80 to
0xFF. It's prone to BIOS bugs, where BIOS can report nonexistent or
phantom drives at higher numbers. It's safer to use fixed disk count
value from 40:75 to limit such loops.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain.c: Introduce sseg and fseg options.
Michal Soltys [Mon, 16 Aug 2010 10:47:02 +0000 (12:47 +0200)]
chain.c: Introduce sseg and fseg options.

Add options for detailed specification of load and jump addresses.
Misc adjustments.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain.c: fix trailing whitespace
Michal Soltys [Sun, 15 Aug 2010 22:46:03 +0000 (00:46 +0200)]
chain.c: fix trailing whitespace

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain.c: move reg setup of dos drive to find_dp()
Michal Soltys [Sun, 15 Aug 2010 22:31:03 +0000 (00:31 +0200)]
chain.c: move reg setup of dos drive to find_dp()

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain.c: add nokeeppxe option and sethid shortcut of sethidden
Michal Soltys [Sun, 15 Aug 2010 22:22:26 +0000 (00:22 +0200)]
chain.c: add nokeeppxe option and sethid shortcut of sethidden

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agodisklib: small fixes / addons
Michal Soltys [Wed, 18 Aug 2010 08:03:55 +0000 (10:03 +0200)]
disklib: small fixes / addons

Functions disk_write_sector() and disk_write_verify_sector()
take 64bit lba as an argument now - similary to disk_read_sectors().

Structure disk_info additionally provides cylinders, besides head and sector.
Sanity checks during lba -> chs conversions have been adjusted to use
cylinders.

CX in cbios read/write code was not calculated properly.

Minor signed/unsigned changes.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain.c: Rename cur_part -> iter
Michal Soltys [Sun, 15 Aug 2010 22:13:51 +0000 (00:13 +0200)]
chain.c: Rename cur_part -> iter

Current iterators go over both disk and partitions, including raw disks.
More generic name fits better into the whole scheme.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain.c minor fix of ADDRMAX value
Michal Soltys [Sun, 15 Aug 2010 22:09:01 +0000 (00:09 +0200)]
chain.c minor fix of ADDRMAX value

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain.c: move regs to opt structure
Michal Soltys [Sun, 15 Aug 2010 22:06:22 +0000 (00:06 +0200)]
chain.c: move regs to opt structure

regs, being a set of starting registers for chainloaded image, fits
logically into opt structure. Also simplifies function callings.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain.c: fix all compiler warnings in very pedantic mode
Michal Soltys [Sun, 15 Aug 2010 21:29:31 +0000 (23:29 +0200)]
chain.c: fix all compiler warnings in very pedantic mode

Compilation of chain.c now passes: -Wextra -Wconversion -pedantic

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain.c: move file mangling outside main()
Michal Soltys [Sun, 15 Aug 2010 21:00:59 +0000 (23:00 +0200)]
chain.c: move file mangling outside main()

All the file mangling code has been moved to
mangle_*() family of functions, currently:

mangle_isolinux()
mangle_grublegacy()
mangle_grldr()
mangle_drmk()

They will be further moved to separate file.

Also, file and sector loading routines are now near each other.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain.c: Adjust hide_unhide() and remove mbr_area from main()
Michal Soltys [Sun, 15 Aug 2010 20:06:11 +0000 (22:06 +0200)]
chain.c: Adjust hide_unhide() and remove mbr_area from main()

hide_unhide() is adjusted to use new iterators. It's also fully
self sufficient.

mbr_area is no longer needed in main().

Check for proper magic when loading bs/mbr is removed. There can be valid bootable
code without 0xaa55 magic (e.g. for testing purposes or unusual tasks).

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agopartiter: Add raw iterators
Michal Soltys [Sun, 15 Aug 2010 12:24:06 +0000 (14:24 +0200)]
partiter: Add raw iterators

As iterators cover the whole disk now, it's possible to be able to still
boot "something" from the 1st sector, even if it has no valid mbr or gpt
layout. This patch adds "raw" iterator, updating necessary code.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain.c: Restructure finding of partition/drive to chainload.
Michal Soltys [Sun, 15 Aug 2010 11:13:04 +0000 (13:13 +0200)]
chain.c: Restructure finding of partition/drive to chainload.

Finding drive or partition to chainload has been moved outside
main() to find_dp(). Further adjustments and fixes made to accomodate
this change.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain.c: move parsing outside main(), move some options to opt structure
Michal Soltys [Sat, 14 Aug 2010 22:06:47 +0000 (00:06 +0200)]
chain.c: move parsing outside main(), move some options to opt structure

Options' parsing can be easily moved outside main().
drivename and partition are part of opt structure now.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain.c: adjust usage(), update placeholder doc/chain.txt
Michal Soltys [Sat, 14 Aug 2010 21:23:33 +0000 (23:23 +0200)]
chain.c: adjust usage(), update placeholder doc/chain.txt

Make usage() info more precise, adjust indentation.
Update placeholder docs.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain.c: add soi2sli() function
Michal Soltys [Sat, 14 Aug 2010 20:58:26 +0000 (22:58 +0200)]
chain.c: add soi2sli() function

Add generic function to convert seg[:off:[ip]] into seg:lin:ip, mostly
in preparation for further updates.

Make opt.seg check use it.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agopartiter.c: tone down non-data sanity checks, add comments in ebr helper
Michal Soltys [Sat, 14 Aug 2010 20:30:35 +0000 (22:30 +0200)]
partiter.c: tone down non-data sanity checks, add comments in ebr helper

Sanity checks vs. programmer are compiled only with DEBUG.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain.c: initial move of documentation to doc/chain.txt
Michal Soltys [Sat, 14 Aug 2010 11:51:39 +0000 (13:51 +0200)]
chain.c: initial move of documentation to doc/chain.txt

This patch moves the commented documentation from chain.c to
placeholder doc/chain.txt.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agodoc/gpt.txt: minor fix
Michal Soltys [Sat, 14 Aug 2010 11:33:29 +0000 (13:33 +0200)]
doc/gpt.txt: minor fix

Information about one field was incorrect.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agochain.c: minor fixes
Michal Soltys [Sat, 14 Aug 2010 11:27:33 +0000 (13:27 +0200)]
chain.c: minor fixes

This fixes segval comparison and two mistypes.

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agosplit chain into chain + iterator, expand iterators' code
Michal Soltys [Sat, 7 Aug 2010 23:13:48 +0000 (01:13 +0200)]
split chain into chain + iterator, expand iterators' code

Patch:

- splits chain into chain and iterator parts and moves them into their
  own com32/chain directory
- extensively updates iterators' code
- adjusts chain.c to use new iterators
- fixes mbr/sect/hand/file allocation

Signed-off-by: Michal Soltys <soltys@ziu.info>
14 years agoMerge branch 'master' into chaindev
Michal Soltys [Sat, 14 Aug 2010 11:16:48 +0000 (13:16 +0200)]
Merge branch 'master' into chaindev

14 years agoextlinux: try to get the disk offset from sysfs
H. Peter Anvin [Sat, 14 Aug 2010 00:27:44 +0000 (17:27 -0700)]
extlinux: try to get the disk offset from sysfs

It is possible(?) that HDIO_GETGEO can't return the full offset, and
in either case it is too small -- only 32 bits on 32-bit platforms.
Thus query sysfs for the real value, if available.

sysfs also contains information for slave devices -- this is going to
really matter for the md/lvm issues.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agodiskio: remove redundant register write
Don Hiatt [Fri, 13 Aug 2010 16:51:12 +0000 (09:51 -0700)]
diskio: remove redundant register write

The disk number is set twice in diskio.c/edd_rdwr_sectors() this patch
removes the redundant setting.

14 years agoversion: next version will be 4.03 syslinux-4.03-pre1
H. Peter Anvin [Wed, 11 Aug 2010 18:50:48 +0000 (11:50 -0700)]
version: next version will be 4.03

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocore: look for invalid MBR handover information address
H. Peter Anvin [Wed, 11 Aug 2010 17:42:51 +0000 (10:42 -0700)]
core: look for invalid MBR handover information address

The Win7 MBR doesn't provide proper handover information.  Instead, it
leaves DS:SI = 0:0x7e00, so reject that information as invalid on
grounds that it is pointed into the bootloader area.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agochain: Extra comments; shrink the new space to minimum
Gene Cumm [Sun, 1 Aug 2010 16:55:27 +0000 (12:55 -0400)]
chain: Extra comments; shrink the new space to minimum

14 years agochain: Just assign the value rather than using memcpy()
Gene Cumm [Sun, 1 Aug 2010 16:39:19 +0000 (12:39 -0400)]
chain: Just assign the value rather than using memcpy()

14 years agochain: add drmk= to usage
Gene Cumm [Sun, 1 Aug 2010 14:23:51 +0000 (10:23 -0400)]
chain: add drmk= to usage

14 years agochain: Fix up and clean up DRMK load code; fix filename length; Patch memory.
Gene Cumm [Sun, 1 Aug 2010 14:23:00 +0000 (10:23 -0400)]
chain: Fix up and clean up DRMK load code; fix filename length;  Patch memory.

14 years agochain.c32: prepare for loading DRMK
Gene Cumm [Sun, 1 Aug 2010 03:14:06 +0000 (23:14 -0400)]
chain.c32: prepare for loading DRMK

14 years agoMerge branch 'master' into disklib
H. Peter Anvin [Fri, 30 Jul 2010 17:24:04 +0000 (10:24 -0700)]
Merge branch 'master' into disklib

Resolved Conflicts:
com32/modules/chain.c

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agosyslxopt: remove lengthy warning message
H. Peter Anvin [Fri, 30 Jul 2010 17:20:08 +0000 (10:20 -0700)]
syslxopt: remove lengthy warning message

Remove a lengthy warning message which cause the actual command
reference to overflow a 24-line screen.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agosyslxopt: fix fatal warnings
H. Peter Anvin [Fri, 30 Jul 2010 17:17:52 +0000 (10:17 -0700)]
syslxopt: fix fatal warnings

Fix fatal warnings in syslxopt.c partly due to legal but non-idiomatic
use of switch().  Since the only purpose was to conditionalize single
output statements, just do it explicitly.

In addition, since they are conditional messages, there is no need to
explain when they apply.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agochain.c: fix public index value in mbr and gpt iterators
Michal Soltys [Fri, 30 Jul 2010 06:46:06 +0000 (08:46 +0200)]
chain.c: fix public index value in mbr and gpt iterators

mbr and gpt iterators skip empty / non-data partitions properly, but don't
update publicly visible index. With this patch, such partitions are counted as
well.

Signed-off-by: Michal Soltys <soltys@ziu.info>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agochain.c: fix public index value in mbr and gpt iterators
Michal Soltys [Fri, 30 Jul 2010 06:46:07 +0000 (08:46 +0200)]
chain.c: fix public index value in mbr and gpt iterators

mbr and gpt iterators skip empty / non-data partitions properly, but don't
update publicly visible index. With this patch, such partitions are counted as
well.

Signed-off-by: Michal Soltys <soltys@ziu.info>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agolibinstaller/syslxopt.c: remove unneeded usage text from certain variants.
Gene Cumm [Tue, 27 Jul 2010 22:58:46 +0000 (18:58 -0400)]
libinstaller/syslxopt.c: remove unneeded usage text from certain variants.

Gert Hulselmans noticed this.

14 years agoMake __free_tagged actually free memory
Sebastian Herbszt [Tue, 27 Jul 2010 12:46:57 +0000 (14:46 +0200)]
Make __free_tagged actually free memory

__free_tagged called by comboot_cleanup_lowmem (core/mem/free.c) doesn't
seem to work correctly. Memory allocated with lmalloc() isn't marked as free
after the allocating module exits:

boot: mem
lowmem_buf: 0x000353e0
boot: mem
lowmem_buf: 0x000553f0
boot: mem
lowmem_buf: 0x00075400
boot: mem
lowmem_buf: 0x00000000
boot:

The expected behaviour

boot: mem
lowmem_buf: 0x000353e0
boot: mem
lowmem_buf: 0x000353e0
boot: mem
lowmem_buf: 0x000353e0

can be achieved with the following patch.

14 years agoMerge branch 'm' into rosh_for_hpa
Gene Cumm [Tue, 27 Jul 2010 02:54:37 +0000 (22:54 -0400)]
Merge branch 'm' into rosh_for_hpa

14 years agocore: define and use set_flags() helper
H. Peter Anvin [Mon, 26 Jul 2010 20:57:34 +0000 (13:57 -0700)]
core: define and use set_flags() helper

Rather than opencoding the arithmetic flag mask, define an inline to
make that happen properly.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agosample: remove obsolete "raw" comboot/com32 samples
H. Peter Anvin [Mon, 26 Jul 2010 20:33:37 +0000 (13:33 -0700)]
sample: remove obsolete "raw" comboot/com32 samples

We really don't want people to write code without using the library,
so just remove these obsolete and no longer functional samples.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agolibmenu: Fix cursor on exit from showmenus()
Gene Cumm [Mon, 26 Jul 2010 19:09:43 +0000 (15:09 -0400)]
libmenu: Fix cursor on exit from showmenus()

This fixes the issue in hdt.c32 that Kent Robotti noticed where
exiting directly from Menu Mode caused the cursor to not be displayed.
This same issue also affects com32/cmenu/simple.c32 and probably
others using showmenus().

Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agocore: don't hang if no config file is found
H. Peter Anvin [Mon, 26 Jul 2010 00:27:37 +0000 (17:27 -0700)]
core: don't hang if no config file is found

If we can't find a configuration file, we need to do something
slightly more friendly than hanging.

Reported-by: Sebastian Herbszt <herbszt@gmx.de>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoMerge remote branch 'sha0/com32lib_disk' into disklib
H. Peter Anvin [Wed, 21 Jul 2010 20:52:52 +0000 (13:52 -0700)]
Merge remote branch 'sha0/com32lib_disk' into disklib

14 years agowin64: experimental Win64 installer (syslinux64.exe) syslinux-4.02
H. Peter Anvin [Wed, 21 Jul 2010 19:33:13 +0000 (12:33 -0700)]
win64: experimental Win64 installer (syslinux64.exe)

Experimental Win64 installer.  This is necessary to be able to run on
WinPE64, since WinPE64 doesn't support running 32-bit binaries.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agowin32: fix README, adjust broken +x bits
H. Peter Anvin [Wed, 21 Jul 2010 19:00:12 +0000 (12:00 -0700)]
win32: fix README, adjust broken +x bits

Fix the win32/README file and adjust some stray +x bits which had
crept in.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agolua: remove obsolete FIXME comment
Geert Stappers [Tue, 20 Jul 2010 22:12:36 +0000 (15:12 -0700)]
lua: remove obsolete FIXME comment

Remove an obsolete FIXME comment; the problem was caused by a stale
library.

14 years agoNEWS: document IP byte order fix. syslinux-4.02-pre5
H. Peter Anvin [Tue, 20 Jul 2010 06:45:18 +0000 (23:45 -0700)]
NEWS: document IP byte order fix.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agopxe: fix byte order of output from parse_dotquad()
H. Peter Anvin [Tue, 20 Jul 2010 06:42:41 +0000 (23:42 -0700)]
pxe: fix byte order of output from parse_dotquad()

parse_dotquad() incorrectly returned output in host byte order.

Reported-by: Alexander Wuerstlein <arw@arw.name>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoextlinux, linux: Ignore --force in these installers syslinux-4.02-pre4
Shao Miller [Tue, 20 Jul 2010 03:34:04 +0000 (23:34 -0400)]
extlinux, linux: Ignore --force in these installers

Previous commits described this behaviour, but did not
actually implement it. :)

Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
14 years agodos: Use libinstaller option parser
Shao Miller [Tue, 20 Jul 2010 03:21:57 +0000 (23:21 -0400)]
dos: Use libinstaller option parser

We will produce an error message if a user attempts
to use an option we don't implement.

Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>