profile/ivi/syslinux.git
13 years agoMerge branch 'master' into chaindev
Michal Soltys [Thu, 18 Nov 2010 20:21:09 +0000 (21:21 +0100)]
Merge branch 'master' into chaindev

13 years agoman: remove long-since-obsolete note about name mangling
H. Peter Anvin [Thu, 18 Nov 2010 20:08:47 +0000 (12:08 -0800)]
man: remove long-since-obsolete note about name mangling

We haven't mangled label names for a very long time...

13 years agocore, pxe: Fix handling of unqualified DNS names
H. Peter Anvin [Sun, 14 Nov 2010 21:14:49 +0000 (13:14 -0800)]
core, pxe: Fix handling of unqualified DNS names

Actually append the domain name to the end of an unqualified DNS name
like we should have done all along.

Reported-by: Gene Cumm <gene.cumm@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agomemdisk: use char array for external symbols
H. Peter Anvin [Sun, 14 Nov 2010 21:13:25 +0000 (13:13 -0800)]
memdisk: use char array for external symbols

Use "extern const char foo[];" for an external symbol rather than
"extern void" (gcc 4.5 fix.)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agogfxboot: use a character array for an absolute symbol
H. Peter Anvin [Sun, 14 Nov 2010 21:12:28 +0000 (13:12 -0800)]
gfxboot: use a character array for an absolute symbol

The best way to access an absolute symbol is "extern const char
foo[];" -- older gccs let you get away with "extern void" but gcc 4.5
chokes on it.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agodisklib: remove improper "inline"
H. Peter Anvin [Sun, 14 Nov 2010 21:11:30 +0000 (13:11 -0800)]
disklib: remove improper "inline"

Remove improper inlines from static functions which cause gcc 4.5 to
abort due to inlining failure.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agocom32: add a centralized bitops header
H. Peter Anvin [Sun, 14 Nov 2010 21:09:48 +0000 (13:09 -0800)]
com32: add a centralized bitops header

Add a centralized bitops header <sys/bitops.h> which uses x86 bitops
instructions.  This is necessary to keep gcc 4.5 from aborting
compilation due to the inlined code being larger than the non-inlined
version, and well, we should really use the bitops.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agoMerge branch 'genec-rosh-for-hpa', remote branches 'genec/sample-make-for-hpa', ...
H. Peter Anvin [Sun, 14 Nov 2010 20:51:07 +0000 (12:51 -0800)]
Merge branch 'genec-rosh-for-hpa', remote branches 'genec/sample-make-for-hpa', 'genec/drmk-ver-for-hpa' and 'genec/pxechain-for-hpa'

13 years agoPXELINUX: shorten code in pxenv call
Gene Cumm [Sat, 13 Nov 2010 16:29:08 +0000 (11:29 -0500)]
PXELINUX: shorten code in pxenv call

Now that both scenarios are clear (do/do not call timer_cleanup/
timer_init), shorten it to eliminate a needless jmp.

13 years agoPXELINUX: add gPXE PXENV_FILE_EXEC in addition to PXENV_RESTART_TFTP; comments
Gene Cumm [Sat, 13 Nov 2010 16:22:54 +0000 (11:22 -0500)]
PXELINUX: add gPXE PXENV_FILE_EXEC in addition to PXENV_RESTART_TFTP; comments

Both of these calls will not return if successful

13 years agover.com: Update some of how DRMK is handled
Gene Cumm [Sat, 6 Nov 2010 12:09:15 +0000 (08:09 -0400)]
ver.com: Update some of how DRMK is handled

13 years agoPXELINUX: Fix timer bug
Gene Cumm [Fri, 5 Nov 2010 17:32:52 +0000 (13:32 -0400)]
PXELINUX: Fix timer bug

Certain calls to the PXE stack could potentially remove us from
memory.  Revert the INT 1Ch timer to its previous state.

13 years agover.com: Fix month calculation for DRMK Build Date
Gene Cumm [Wed, 3 Nov 2010 02:52:09 +0000 (22:52 -0400)]
ver.com: Fix month calculation for DRMK Build Date

13 years agosample/Makefile: re-add the include
Gene Cumm [Mon, 25 Oct 2010 17:01:24 +0000 (13:01 -0400)]
sample/Makefile: re-add the include

Without the include, .ppm.gz to .lss messes up as $(GZIPPROG) is
not expanded properly

13 years agomodules/Makefile: add ver.com
Gene Cumm [Mon, 25 Oct 2010 16:59:47 +0000 (12:59 -0400)]
modules/Makefile: add ver.com

13 years agover.com: Fixed width number output; Conditional skip DOS serial
Gene Cumm [Mon, 25 Oct 2010 16:56:36 +0000 (12:56 -0400)]
ver.com: Fixed width number output; Conditional skip DOS serial

Create two functions, writedecb[23], to output a byte AL as fixed with of
2 or 3 characters wide, 0 prepend

If all of the DOS Serialnumber is 0, don't bother with printing anything.

13 years agocom32/chain: minor fixes and cleanups
Michal Soltys [Mon, 25 Oct 2010 10:30:19 +0000 (12:30 +0200)]
com32/chain: minor fixes and cleanups

- make sure opt.maps implies opt.sect, and simplify
  conditions throughout the files
- move structure opt -> options.c
- adjust #includes
- omitted values in seg= and sect= are assumed 0
  in all cases now
- mangler_handover(): eax for gpt handover set only for
  iterated disks
- rename parse_args() -> opt_parse_args()
- rename mangler_common() -> mangler_init()
- add opt_set_defs()
- if mmapped sector would conflict with the file, turn
  off mmapping instead of bailing out
- update temporary chain.txt to reflect changes + other
  fixups

Signed-off-by: Michal Soltys <soltys@ziu.info>
13 years agoMerge branch 'master' into chaindev
Michal Soltys [Mon, 25 Oct 2010 08:27:23 +0000 (10:27 +0200)]
Merge branch 'master' into chaindev

Conflicts:
com32/modules/chain.c

Changes to DRMK imported into commented-out section
of com32/chain/mangle.c

Signed-off-by: Michal Soltys <soltys@ziu.info>
13 years agover.com: Compact file by reuse of string
Gene Cumm [Mon, 25 Oct 2010 00:03:23 +0000 (20:03 -0400)]
ver.com: Compact file by reuse of string

13 years agover.com: Update to pull info from DRMK
Gene Cumm [Sun, 24 Oct 2010 21:30:30 +0000 (17:30 -0400)]
ver.com: Update to pull info from DRMK

13 years agocore/writedec: Remove writechr; fix overflow in .cloop
Gene Cumm [Sun, 24 Oct 2010 21:15:41 +0000 (17:15 -0400)]
core/writedec: Remove writechr; fix overflow in .cloop

writechr is found in other files and this prevents a compile error.

13 years agover.com: Import from previously private branch as new file
Gene Cumm [Sun, 24 Oct 2010 14:14:53 +0000 (10:14 -0400)]
ver.com: Import from previously private branch as new file

13 years agocom32/chain/chain.c: fix if-order during handover preparation
Michal Soltys [Thu, 21 Oct 2010 12:17:07 +0000 (14:17 +0200)]
com32/chain/chain.c: fix if-order during handover preparation

When the handover area is being prepared, most primitive case
should be checked first (not-iterated disk, including typeraw).

Signed-off-by: Michal Soltys <soltys@ziu.info>
13 years agogfxboot: fix buffer overrun when loading kernel/initramfs syslinux-4.03
Colin Watson [Wed, 20 Oct 2010 19:23:02 +0000 (21:23 +0200)]
gfxboot: fix buffer overrun when loading kernel/initramfs

If the file size wasn't a multiple of 64KB, we could overwrite the next
entry in the malloc arena so reading the initramfs would fail.

Signed-off-by: Colin Watson <cjwatson@ubuntu.com>
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
13 years agorosh: rosh_argcat now has length. if DO_DEBUG, show startup command
Gene Cumm [Sat, 16 Oct 2010 12:07:02 +0000 (08:07 -0400)]
rosh: rosh_argcat now has length.  if DO_DEBUG, show startup command

13 years agorosh: display command entered and a command unknown message when not known
Gene Cumm [Sat, 16 Oct 2010 11:58:31 +0000 (07:58 -0400)]
rosh: display command entered and a command unknown message when not known

13 years agoMerge remote branch 'liu/master' syslinux-4.03-pre6
H. Peter Anvin [Fri, 15 Oct 2010 23:41:02 +0000 (16:41 -0700)]
Merge remote branch 'liu/master'

13 years agochain.c32: DRMK: Fix comment at top of source
Gene Cumm [Fri, 15 Oct 2010 03:50:58 +0000 (23:50 -0400)]
chain.c32: DRMK: Fix comment at top of source

13 years agoMerge branch 'master' into chaindev
Michal Soltys [Thu, 14 Oct 2010 21:08:55 +0000 (23:08 +0200)]
Merge branch 'master' into chaindev

Conflicts:
com32/modules/chain.c

13 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>
13 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>
13 years agochain.c32: DRMK: Add comment about only using a DWORD for partition offset
Gene Cumm [Wed, 13 Oct 2010 23:51:06 +0000 (19:51 -0400)]
chain.c32: DRMK: Add comment about only using a DWORD for partition offset

13 years agochain.c32: DRMK: clean up output; clean up and correct comments
Gene Cumm [Wed, 13 Oct 2010 23:39:19 +0000 (19:39 -0400)]
chain.c32: DRMK: clean up output; clean up and correct comments

13 years agochain.c: Progress on DRMK and notes that it's not perfect yet.
Gene Cumm [Mon, 9 Aug 2010 16:34:32 +0000 (12:34 -0400)]
chain.c: Progress on DRMK and notes that it's not perfect yet.

13 years agoMerge branch 'master' into rosh_for_hpa
Gene Cumm [Wed, 13 Oct 2010 20:32:13 +0000 (16:32 -0400)]
Merge branch 'master' into rosh_for_hpa

13 years agorosh: add another item in the ToDos comment
Gene Cumm [Wed, 13 Oct 2010 20:28:53 +0000 (16:28 -0400)]
rosh: add another item in the ToDos comment

13 years agoMerge branch 'disklibdev' into chaindev
Michal Soltys [Wed, 13 Oct 2010 18:50:47 +0000 (20:50 +0200)]
Merge branch 'disklibdev' into chaindev

13 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>
13 years agogfxboot: add include and menu include support syslinux-4.03-pre5
Colin Watson [Wed, 14 Jul 2010 13:11:14 +0000 (14:11 +0100)]
gfxboot: add include and menu include support

Ubuntu CDs use multiple configuration files and the include directive as
well as gfxboot, so it's useful for gfxboot to support these.

Signed-off-by: Colin Watson <cjwatson@ubuntu.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agodoc: extlinux falls back to syslinux.cfg
Ferenc Wagner [Mon, 11 Oct 2010 15:55:52 +0000 (17:55 +0200)]
doc: extlinux falls back to syslinux.cfg

Signed-off-by: Ferenc Wagner <wferi@niif.hu>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agodoc: reorganize config file intro
Ferenc Wagner [Mon, 11 Oct 2010 15:55:51 +0000 (17:55 +0200)]
doc: reorganize config file intro

Signed-off-by: Ferenc Wagner <wferi@niif.hu>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agodoc: comments don't need a leading space
Ferenc Wagner [Mon, 11 Oct 2010 15:55:50 +0000 (17:55 +0200)]
doc: comments don't need a leading space

Signed-off-by: Ferenc Wagner <wferi@niif.hu>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agochain.c32: make CHS calculation match core/fs/diskio.c
H. Peter Anvin [Wed, 13 Oct 2010 05:46:15 +0000 (22:46 -0700)]
chain.c32: make CHS calculation match core/fs/diskio.c

Use the same format for the CHS calculation as in core/fs/diskio.c;
also, apply the correct limits, and propagate the fix to the write
routine.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agostrspn.c: drop "inline"
H. Peter Anvin [Wed, 13 Oct 2010 05:42:27 +0000 (22:42 -0700)]
strspn.c: drop "inline"

Drop "inline" from bit operations.  These should be recoded to use x86
bts/bt instructions, but for now just drop the "inline" which causes
failures on gcc 4.5 due to inlining failures.

Reported-by: Sebastian Herbszt <herbszt@gmx.de>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agoNEWS: Update for 4.03
H. Peter Anvin [Wed, 13 Oct 2010 05:40:46 +0000 (22:40 -0700)]
NEWS: Update for 4.03

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agoisohybrid: Use ftruncate instead of seek for final padding
P J P [Tue, 14 Sep 2010 06:38:37 +0000 (12:08 +0530)]
isohybrid: Use ftruncate instead of seek for final padding

Pad the image via ftruncate instead of seeking to the end (which was
done incorrectly).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agochain.c32: fix conversion from LBA to CHS
H. Peter Anvin [Wed, 13 Oct 2010 05:31:09 +0000 (22:31 -0700)]
chain.c32: fix conversion from LBA to CHS

Bits [9:8] of the cylinder goes into the top bits of the sector
register, not the bottom (and the math for that was wrong, anyway.)

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

13 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>
13 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

13 years agorosh: Fix rosh_ls(); fix FTBFS on rosh_more(); add ROSH_DEBUG2_ARGV_V macro
Gene Cumm [Sat, 9 Oct 2010 15:28:48 +0000 (11:28 -0400)]
rosh: Fix rosh_ls(); fix FTBFS on rosh_more(); add ROSH_DEBUG2_ARGV_V macro

13 years agolib: Update memmem function
Liu Aleaxander [Sat, 9 Oct 2010 15:10:14 +0000 (23:10 +0800)]
lib: Update memmem function

The current memem implementation can not handle the case that the length
of the third parameter(needle) is equal *ONE*. So that the current
strstr implemention doesn't work when the lenght of substring is ONE.

For example, strstr("linux", "l") it will return NULL instead of
"linux", which is not right.

This code is stolen from klibc ;)

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
13 years agounistd.h: Add missing getopt declarations
Gene Cumm [Sat, 9 Oct 2010 12:32:46 +0000 (08:32 -0400)]
unistd.h: Add missing getopt declarations

13 years agoMerge branch 'master' into rosh_for_hpa
Gene Cumm [Sat, 9 Oct 2010 11:41:12 +0000 (07:41 -0400)]
Merge branch 'master' into rosh_for_hpa

13 years agorosh: Remove unneeded cases in rosh_command() switch statements
Gene Cumm [Sun, 3 Oct 2010 22:28:02 +0000 (18:28 -0400)]
rosh: Remove unneeded cases in rosh_command() switch statements

13 years agorosh: Clean up rosh_command to remove old stuff
Gene Cumm [Sun, 3 Oct 2010 16:05:45 +0000 (12:05 -0400)]
rosh: Clean up rosh_command to remove old stuff

13 years agorosh: code cleanup
Gene Cumm [Sun, 3 Oct 2010 14:02:11 +0000 (10:02 -0400)]
rosh: code cleanup

13 years agorosh: Change rosh_ls()/rosh_dir() to use argc/argv; use getopt()
Gene Cumm [Sun, 3 Oct 2010 13:24:38 +0000 (09:24 -0400)]
rosh: Change rosh_ls()/rosh_dir() to use argc/argv; use getopt()

13 years agorosh: Change rosh_more()/rosh_less() to use argc/argv
Gene Cumm [Sun, 3 Oct 2010 13:15:52 +0000 (09:15 -0400)]
rosh: Change rosh_more()/rosh_less() to use argc/argv

13 years agorosh: remove cmdstr from rosh_pwd()
Gene Cumm [Sun, 3 Oct 2010 11:22:59 +0000 (07:22 -0400)]
rosh: remove cmdstr from rosh_pwd()

13 years agorosh: clear errno before possibly using it. might be set by a previous call
Gene Cumm [Sun, 3 Oct 2010 11:17:54 +0000 (07:17 -0400)]
rosh: clear errno before possibly using it.  might be set by a previous call

13 years agorosh: Add argc/argv rosh_reboot(); Allow warm reboots
Gene Cumm [Sun, 3 Oct 2010 11:12:06 +0000 (07:12 -0400)]
rosh: Add argc/argv rosh_reboot(); Allow warm reboots

13 years agorosh: In main, use string macro directly
Gene Cumm [Sun, 3 Oct 2010 11:00:25 +0000 (07:00 -0400)]
rosh: In main, use string macro directly

13 years agorosh: Change rosh_run() to use argc/argv
Gene Cumm [Sun, 3 Oct 2010 10:59:44 +0000 (06:59 -0400)]
rosh: Change rosh_run() to use argc/argv

13 years agorosh: Change rosh_help() to use the string passed to it directly
Gene Cumm [Sat, 2 Oct 2010 17:20:07 +0000 (13:20 -0400)]
rosh: Change rosh_help() to use the string passed to it directly

13 years agorosh: ROSH_DEBUG_ARGV_V in header
Gene Cumm [Sat, 2 Oct 2010 05:11:23 +0000 (01:11 -0400)]
rosh: ROSH_DEBUG_ARGV_V in header

13 years agorosh: convert rosh_cat() to argc/argv
Gene Cumm [Sat, 2 Oct 2010 05:10:49 +0000 (01:10 -0400)]
rosh: convert rosh_cat() to argc/argv

13 years agorosh: Add function header comments that were missing
Gene Cumm [Sat, 2 Oct 2010 05:05:03 +0000 (01:05 -0400)]
rosh: Add function header comments that were missing

13 years agorosh: Fix warning on rosh_ls_arg(); remove rosh_echo() for rosh_pr_argv()
Gene Cumm [Sat, 2 Oct 2010 04:55:02 +0000 (00:55 -0400)]
rosh: Fix warning on rosh_ls_arg(); remove rosh_echo() for rosh_pr_argv()

13 years agorosh: Rename function as it's verbose
Gene Cumm [Sat, 2 Oct 2010 04:43:24 +0000 (00:43 -0400)]
rosh: Rename function as it's verbose

rosh_pr_argv and ROSH_DEBUG_ARGV are verbose, printing the
argument number and single-quoted string out.

13 years agorosh: closedir() only if actually opened
Gene Cumm [Sat, 2 Oct 2010 04:18:27 +0000 (00:18 -0400)]
rosh: closedir() only if actually opened

13 years agorosh: compact previous commit
Gene Cumm [Sat, 2 Oct 2010 04:16:54 +0000 (00:16 -0400)]
rosh: compact previous commit

13 years agorosh: Fix rosh_ls_arg() to prevent segfault on access denied
Gene Cumm [Sat, 2 Oct 2010 04:13:38 +0000 (00:13 -0400)]
rosh: Fix rosh_ls_arg() to prevent segfault on access denied

13 years agorosh: main, prompt and command try to use argc/argv mostly
Gene Cumm [Sat, 2 Oct 2010 04:03:29 +0000 (00:03 -0400)]
rosh: main, prompt and command try to use argc/argv mostly

prompt still uses a string but parses it and passes the parsed
argc/argv pair to command.  main doesn't need a string anymore

13 years agorosh: rosh_cd fix DEBUG
Gene Cumm [Fri, 1 Oct 2010 03:11:10 +0000 (23:11 -0400)]
rosh: rosh_cd fix DEBUG

13 years agorosh: fix errors in previous commit
Gene Cumm [Fri, 1 Oct 2010 03:08:24 +0000 (23:08 -0400)]
rosh: fix errors in previous commit

13 years agorosh: change rosh_cd() to use argc/argv
Gene Cumm [Fri, 1 Oct 2010 03:03:35 +0000 (23:03 -0400)]
rosh: change rosh_cd() to use argc/argv

13 years agorosh: Use internal parser for argc/argv; use argc/argv in rosh_command
Gene Cumm [Fri, 1 Oct 2010 02:41:21 +0000 (22:41 -0400)]
rosh: Use internal parser for argc/argv; use argc/argv in rosh_command

13 years agorosh: start parse_args(); prep for use; make print_argv()
Gene Cumm [Fri, 24 Sep 2010 02:06:10 +0000 (22:06 -0400)]
rosh: start parse_args(); prep for use; make print_argv()

parse_args() for parsing a string into an argv/argc pair for easier
parsing and the potential use of getopt().

print_argv() for printing an argv/argc pair to show functionality

13 years agorosh: fix commented out WS usage in linux to grab screen size
Gene Cumm [Tue, 20 Jul 2010 15:56:28 +0000 (11:56 -0400)]
rosh: fix commented out WS usage in linux to grab screen size

13 years agorosh: add echo
Gene Cumm [Fri, 9 Jul 2010 00:05:39 +0000 (20:05 -0400)]
rosh: add echo

13 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

13 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'

13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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

13 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>
13 years agoMerge branch 'master' into chaindev
Michal Soltys [Tue, 28 Sep 2010 10:50:32 +0000 (12:50 +0200)]
Merge branch 'master' into chaindev

13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>