profile/ivi/syslinux.git
14 years agoMerge branch 'master' into fsc
H. Peter Anvin [Fri, 4 Sep 2009 22:47:51 +0000 (15:47 -0700)]
Merge branch 'master' into fsc

14 years agocore: add missing calls to cleanup_hardware syslinux-3.83-pre10
H. Peter Anvin [Fri, 4 Sep 2009 22:46:43 +0000 (15:46 -0700)]
core: add missing calls to cleanup_hardware

As we're starting to rely more and more on a modified hardware state,
it is really important to clean up on all exit paths.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoMerge branch 'master' into fsc
H. Peter Anvin [Fri, 4 Sep 2009 22:14:22 +0000 (15:14 -0700)]
Merge branch 'master' into fsc

Resolved Conflicts:
core/pxelinux.asm

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agopxelinux: workaround for EFI CSM bug - BEV stack overwrite on localboot
H. Peter Anvin [Fri, 4 Sep 2009 22:09:50 +0000 (15:09 -0700)]
pxelinux: workaround for EFI CSM bug - BEV stack overwrite on localboot

On at least some machines with an EFI-based BIOS, the Compatibility
Service Module (CSM) puts the BEV stack at an address where the boot
loader is likely to overwrite it.  Implement a workaround which forces
INT 18h instead if an EFI signature is detected in memory.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocore: pxe: don't confuse index and data when searching...
H. Peter Anvin [Fri, 4 Sep 2009 00:18:24 +0000 (17:18 -0700)]
core: pxe: don't confuse index and data when searching...

Don't confuse the index and data when searching the PCI ID table for
special idle handling.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocore: move the generated IDT stubs to a separate .gentext16 section
H. Peter Anvin [Thu, 3 Sep 2009 05:48:57 +0000 (22:48 -0700)]
core: move the generated IDT stubs to a separate .gentext16 section

Move the generated IDT stubs to a separate section, .gentext16, so
that they aren't immediately adjacent to a piece of highly mutable
data.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocore: make sure __jiffies is aligned
H. Peter Anvin [Thu, 3 Sep 2009 05:28:38 +0000 (22:28 -0700)]
core: make sure __jiffies is aligned

__jiffies really wants to be aligned.  We're not SMP, so technically
it will be atomic anyway.  Still...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocore: pxe: create a single tftp_error() function, send ERROR on close
H. Peter Anvin [Thu, 3 Sep 2009 04:09:33 +0000 (21:09 -0700)]
core: pxe: create a single tftp_error() function, send ERROR on close

Create a single function to generate a TFTP error.  We really should
be better about distinguishing different error conditions.

Send an ERROR packet if we're closing a file which still has an open
connection.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocore: use jiffies instead of BIOS_timer
H. Peter Anvin [Thu, 3 Sep 2009 00:55:56 +0000 (17:55 -0700)]
core: use jiffies instead of BIOS_timer

Use jiffies instead of BIOS_timer.  In 16-bit code we can use the low
16 bits of __jiffies when appropriate, since we have proper 2's
complement wraparound at all times.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocore: hook INT 1Ch for a simple monotonic timer
H. Peter Anvin [Thu, 3 Sep 2009 00:44:32 +0000 (17:44 -0700)]
core: hook INT 1Ch for a simple monotonic timer

The BIOS_timer variable at 4C6h is somewhat unreliable... it is
documented to wrap at "midnight", norminally after 1627419 ticks
(0x18d51b), which is a rather awkward number to deal with modulo.
Instead, hook the INT 1Ch secondary timer interrupt and just count a
simple incrementing variable.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocore: merge cpuinit.inc into init.inc
H. Peter Anvin [Thu, 3 Sep 2009 00:31:53 +0000 (17:31 -0700)]
core: merge cpuinit.inc into init.inc

The separation between cpuinit.inc and init.inc has never been very
clear, and it just made the code harder to read.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocore: pxe: fix the behavior on non-received RRQ reply
H. Peter Anvin [Thu, 3 Sep 2009 00:20:48 +0000 (17:20 -0700)]
core: pxe: fix the behavior on non-received RRQ reply

Fix the behavior when we don't immediately get a valid reply to an RRQ
packet.  In particular, we would interpret what was previously in the
buffer as the requested data, whereas in general it hadn't even been
written to.

Reported-by: Sebastian Herbszt <herbszt@gmx.de>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocore: pxe: use FAR_PTR() macro where appropriate
H. Peter Anvin [Wed, 2 Sep 2009 00:13:41 +0000 (17:13 -0700)]
core: pxe: use FAR_PTR() macro where appropriate

Use the FAR_PTR() macro to convert a pointer in lowmem to SEG:OFFS
format as unit.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocore: pxe: remove vestigial dnsresolv.inc
H. Peter Anvin [Wed, 2 Sep 2009 00:08:52 +0000 (17:08 -0700)]
core: pxe: remove vestigial dnsresolv.inc

Remove dnsresolv.inc, which was already unused except for a couple of
buffer declarations.  Move those buffers to regular C variables.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocore: pxe: port the PXE idle function to C
H. Peter Anvin [Tue, 1 Sep 2009 23:58:11 +0000 (16:58 -0700)]
core: pxe: port the PXE idle function to C

Port the PXE idle function to C; make the idle hook a protected-mode
call.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocore: drop any .eh_frame sections syslinux-4.00-pre5
H. Peter Anvin [Tue, 1 Sep 2009 03:55:11 +0000 (20:55 -0700)]
core: drop any .eh_frame sections

We have no use of .eh_frames...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoMerge branch 'master' into fsc
H. Peter Anvin [Tue, 1 Sep 2009 03:33:27 +0000 (20:33 -0700)]
Merge branch 'master' into fsc

14 years agocore: booleanize the return value from *_load_config() syslinux-4.00-pre4
H. Peter Anvin [Sun, 30 Aug 2009 16:46:45 +0000 (09:46 -0700)]
core: booleanize the return value from *_load_config()

The *_load_config() file is specific to each filesystem, and
documented to return 0 or 1.  Make sure the return value actually is
zero or one.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoCore:pxelinux: fix the config file loading when we got a DHCP option
Liu Aleaxander [Sun, 30 Aug 2009 22:22:26 +0000 (06:22 +0800)]
Core:pxelinux: fix the config file loading when we got a DHCP option

I knew what the DHCP option is now.

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agoCore: get rid of passing com32sys_t structure as parameter in PMode
Liu Aleaxander [Sun, 30 Aug 2009 21:51:38 +0000 (05:51 +0800)]
Core: get rid of passing com32sys_t structure as parameter in PMode

Well, this molstly be about xxx_load_config function, with function type changed.
The new load_config function will return 1 if failed, or 0 if successed.

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agoCore:pxelinux: add %if IS_PXELINUX statement in extern.inc
Liu Aleaxander [Sun, 30 Aug 2009 20:25:00 +0000 (04:25 +0800)]
Core:pxelinux: add %if IS_PXELINUX statement in extern.inc

Add this to avoid the compile error.

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agoCore:pxelinux: code clean
Liu Aleaxander [Sat, 29 Aug 2009 23:05:58 +0000 (07:05 +0800)]
Core:pxelinux: code clean

Two main things:
1. Redeclare the varibales that are't needed by any asm files in C file.
2. Move the extern statements of PXELINUX into pxe.h, instead of in core.h

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agoCore:pxelinux: unload_pxe converted.
Liu Aleaxander [Sat, 29 Aug 2009 21:37:30 +0000 (05:37 +0800)]
Core:pxelinux: unload_pxe converted.

I found it's also better to convert the unload_pxe, but I am not sure I'm right.

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agoCore:pxelinux: code clean--removes the unused variables in ASM file
Liu Aleaxander [Sat, 29 Aug 2009 20:13:40 +0000 (04:13 +0800)]
Core:pxelinux: code clean--removes the unused variables in ASM file

And also converts some asm-variables to c-variables.

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agoCore:pxelinux: The pxe structures are all converted to standard structures. syslinux-4.00-pre3
Liu Aleaxander [Fri, 28 Aug 2009 23:18:12 +0000 (07:18 +0800)]
Core:pxelinux: The pxe structures are all converted to standard structures.

converts the current pxe structures to standard structures; removes the old one in pxe.h.

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agoCore: code clean -- re-style the unstyle code
Liu Aleaxander [Fri, 28 Aug 2009 14:55:52 +0000 (22:55 +0800)]
Core: code clean -- re-style the unstyle code

With the emacs config given by hpa, which is really powfull, I restyled the
unsytled code.

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agoCore:pxelinux: fix the probaly hang when use host
Liu Aleaxander [Fri, 28 Aug 2009 11:26:04 +0000 (19:26 +0800)]
Core:pxelinux: fix the probaly hang when use host

We shoud check the server if vaild or not; if not, move no until we run out
the time.

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agoCore: vfs-dir stuff cleaned
Liu Aleaxander [Fri, 28 Aug 2009 10:56:00 +0000 (18:56 +0800)]
Core: vfs-dir stuff cleaned

Removes the core/include/dir.h, and put the dir structures to sys/dirent.h to
avoid the compile error.

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agoCore: vfs-dir stuff re-implemented
Liu Aleaxander [Fri, 28 Aug 2009 10:27:51 +0000 (18:27 +0800)]
Core: vfs-dir stuff re-implemented

We fist make it simple, as told by hpa. Here're the changes:
1, The DIR structure changed, just a file pointer included.
2. So, the open/close/read-dir stuff in com32/lib/ changed again.
3. We read one stuff from every readdir call.

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agoCore: opendir/readdir/closedir stuff added
Liu Aleaxander [Wed, 26 Aug 2009 23:37:44 +0000 (07:37 +0800)]
Core: opendir/readdir/closedir stuff added

Here're some big changes:
1. The vfs-dir stuff added.
2. The dir-functions in com32/lib are mostly rewritten.
3. with little change on rosh for avoid the compile error

Well, I don't think it's a good vfs-dir interface.

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agoNEWS: update for 3.83
H. Peter Anvin [Wed, 26 Aug 2009 04:19:26 +0000 (21:19 -0700)]
NEWS: update for 3.83

14 years agoCore:pxelinux: fix the dns_resolv call reference in pxe.c
Aleaxander [Tue, 25 Aug 2009 21:32:38 +0000 (05:32 +0800)]
Core:pxelinux: fix the dns_resolv call reference in pxe.c

The current dns_resolv function doesn't update the _name_ string, so we should
use the strstr things to make the _p_ pointer to point to the right address we
want.

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agodnsresolv: compare returned name; "better" CNAME handling
H. Peter Anvin [Mon, 24 Aug 2009 23:32:48 +0000 (16:32 -0700)]
dnsresolv: compare returned name; "better" CNAME handling

Compare the returned name with the name we requested.  Handle CNAMEs
by overwriting the requested name with the CNAME, however, we really
should:

a) rescan the packet from the beginning;
b) send a new request if we get no A record for the CNAME.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agodnsresolv: fix timeouts, clean up types
H. Peter Anvin [Mon, 24 Aug 2009 22:43:21 +0000 (15:43 -0700)]
dnsresolv: fix timeouts, clean up types

Fix timeouts: it was way too easy to make the code give up, which
often resulted in a zero response even if valid data would soon be
available.

Also avoid passing char ** when we don't really need it.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agonetinet/in.h: fix output types
H. Peter Anvin [Mon, 24 Aug 2009 22:41:30 +0000 (15:41 -0700)]
netinet/in.h: fix output types

We need casts not just on input but on output, in order to make sure
only the correct bits are visible.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agohdt: enhance error reporting in the CLI (disk) syslinux-3.83-pre9
Pierre-Alexandre Meyer [Sat, 22 Aug 2009 18:08:04 +0000 (11:08 -0700)]
hdt: enhance error reporting in the CLI (disk)

parse_partition_table can fail for two reasons: disk I/O
error or unrecognized partition layout (non msdos, corrupt, ...).

In the latter case, we were displaying

   Error parsing disk 0x80
   parse_partition_table: error 0

which is confusing. We now display

   Disk 0x80: unrecognized partition layout

or the errno_disk in case of I/O errors.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
14 years agohdt: make get_error behaves like perror
Pierre-Alexandre Meyer [Sat, 22 Aug 2009 17:34:40 +0000 (10:34 -0700)]
hdt: make get_error behaves like perror

This simplifies buffer handling.

Misc.: clean some old error code handling.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
14 years agohdt: fix CLI crash when parsing unsupported geometries
Pierre-Alexandre Meyer [Sat, 22 Aug 2009 16:42:37 +0000 (09:42 -0700)]
hdt: fix CLI crash when parsing unsupported geometries

Remove extra free() calls: these were needed before the introduction
of the disklib errno. We apparently forgot to remove them.

Reported-by: Gert Hulselmans <hulselmansgert@gmail.com>
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
14 years agoCore:PXELINUX: dns_resolv problem resolved.
Liu Aleaxander [Fri, 21 Aug 2009 03:41:43 +0000 (11:41 +0800)]
Core:PXELINUX: dns_resolv problem resolved.

Now the dns_resolv program can work correctly now except sometimes you should add some
DNS servers manually by yourself if your current DNS server can not work, this mostly happen
when you use something like Qemu.

And, we added a host c32 module written by hpa, as a dns resolver test.

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agohdt: 0.3.4 syslinux-3.83-pre8
erwan [Thu, 20 Aug 2009 04:24:16 +0000 (06:24 +0200)]
hdt: 0.3.4

Impact: New release

0.3.4 is now out !

14 years agohdt: fix disklib display
Pierre-Alexandre Meyer [Thu, 20 Aug 2009 04:20:40 +0000 (21:20 -0700)]
hdt: fix disklib display

We currently display the first sector after the end of an extended.
Fix it (-1).

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
14 years agodisklib: fix extended partition code
Pierre-Alexandre Meyer [Thu, 20 Aug 2009 04:12:57 +0000 (21:12 -0700)]
disklib: fix extended partition code

gert1 reported some issues using disklib with HDT. As it turned out, the
code that iterated through ebrs in an extended partition was broken: ebr offsets
need to be relative to the start of that partition.

Misc.: fix memory leak.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Signed-off-by: Erwan Velu <erwan.velu@free.fr>
14 years agohdt: Fixing memory corruption
erwan [Wed, 19 Aug 2009 22:19:44 +0000 (00:19 +0200)]
hdt: Fixing memory corruption

Impact: Improve stability

In some case, sectors_to_size can return a 8 char long string like "1000
MiB". In such case, some buffer were corrupted.

This is now fixed by a size[9] instead of size[8].

14 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/boot/syslinux/syslinux into...
erwan [Wed, 19 Aug 2009 21:50:50 +0000 (23:50 +0200)]
Merge branch 'master' of git://git./boot/syslinux/syslinux into origin/master

14 years agoMerge commit 'pam/disklib-fixes'
Erwan Velu [Wed, 19 Aug 2009 19:17:49 +0000 (21:17 +0200)]
Merge commit 'pam/disklib-fixes'

14 years agoCore:PXELINUX: dnsrelov.inc converted
Liu Aleaxander [Wed, 19 Aug 2009 10:47:04 +0000 (18:47 +0800)]
Core:PXELINUX: dnsrelov.inc converted

The dnsrelov converted to C.

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agoMEMDISK: generate map files syslinux-3.83-pre7
H. Peter Anvin [Tue, 18 Aug 2009 02:06:01 +0000 (19:06 -0700)]
MEMDISK: generate map files

Generate map files to make debugging less painful.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agomemdisk: make the stack size configurable
H. Peter Anvin [Mon, 17 Aug 2009 02:51:38 +0000 (19:51 -0700)]
memdisk: make the stack size configurable

Make it possible to configure the stack size on the command line,
so that we can rule that out in case of problems.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoCore:PXELINUX: improve the pxe_mangle_name in pxe.c
Liu Aleaxander [Mon, 17 Aug 2009 23:47:55 +0000 (07:47 +0800)]
Core:PXELINUX: improve the pxe_mangle_name in pxe.c

the old code has so many goto sentences and labels, so improve it and remove them

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agomenu: initialize cm (current menu) before empty check
H. Peter Anvin [Mon, 17 Aug 2009 19:26:08 +0000 (12:26 -0700)]
menu: initialize cm (current menu) before empty check

The empty check in the menu system used "cm", but before "cm" had
actually been initialized.  Move the "cm" initialization earlier so we
do the right thing here.

Reported-by: CKSoon <cksoon79@yahoo.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoCore: fat: make the file->file_len to store the dir sector number when we search...
Liu Aleaxander [Mon, 17 Aug 2009 08:28:52 +0000 (16:28 +0800)]
Core: fat: make the file->file_len to store the dir sector number when we search a dir

Because the opendir function in com32/lib/opendir.c use the eax to store the
dir sector, where we store the file_len before. Well, we may need add a union
structure in the file structure to store the file_len for file, file_dir for
dir respecifictly

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agoCore: code clean
Liu Aleaxander [Sun, 16 Aug 2009 08:41:40 +0000 (16:41 +0800)]
Core: code clean

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agoMerge commit 'origin/master'
H. Peter Anvin [Sat, 15 Aug 2009 00:22:01 +0000 (17:22 -0700)]
Merge commit 'origin/master'

14 years agocore: kaboom.c: file missing from previous checkin
H. Peter Anvin [Fri, 14 Aug 2009 05:32:08 +0000 (22:32 -0700)]
core: kaboom.c: file missing from previous checkin

kaboom.c; necessary file missing from previous checkin.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agomenu: fix Ctrl-W (word erase) when editing a command line
H. Peter Anvin [Fri, 14 Aug 2009 05:31:13 +0000 (22:31 -0700)]
menu: fix Ctrl-W (word erase) when editing a command line

The Ctrl-W (word erase) key was broken: it would think the command
line got longer, not shorter, resulting in havoc.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoRevert "Run Nindent on com32/include/pngconf.h"
H. Peter Anvin [Thu, 13 Aug 2009 22:27:46 +0000 (15:27 -0700)]
Revert "Run Nindent on com32/include/pngconf.h"

This reverts commit 6361b71f87466877f8fd1273240e8fa4460f8d05.

<pngconf.h> is part of libpng, it should never have been Nindented.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoRevert "Run Nindent on com32/include/png.h"
H. Peter Anvin [Thu, 13 Aug 2009 22:26:49 +0000 (15:26 -0700)]
Revert "Run Nindent on com32/include/png.h"

This reverts commit ab7b6c3380cd9188edbc99693d5562dcca055317.

<png.h> is part of libpng and hence externally maintained; it should
not have been Nindented.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocore: cleaner way to call kaboom from 32-bit code
H. Peter Anvin [Thu, 13 Aug 2009 04:51:54 +0000 (21:51 -0700)]
core: cleaner way to call kaboom from 32-bit code

Make kaboom() a noreturn function directly callable from 32-bit code.
Do a special macro hack to keep it from interfering with the symbol
kaboom in 16-bit code.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agonetinet/in.h: add __constfunc to inlines
H. Peter Anvin [Thu, 13 Aug 2009 04:39:52 +0000 (21:39 -0700)]
netinet/in.h: add __constfunc to inlines

All the byte-swapping functions are true constfuncs...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agonetinet/in.h: put in explicit casts for all the hton/ntoh macros
H. Peter Anvin [Thu, 13 Aug 2009 04:37:29 +0000 (21:37 -0700)]
netinet/in.h: put in explicit casts for all the hton/ntoh macros

For the macro versions of hton/ntoh, use casts everywhere.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocore: use stpcpy() as generic_unmangle_name()
H. Peter Anvin [Thu, 13 Aug 2009 04:31:49 +0000 (21:31 -0700)]
core: use stpcpy() as generic_unmangle_name()

We can use stpcpy() as generic_unmangle_name(); this also gives us the
pointer to the end that the assembly code wants and expects.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoiso9660: adjust to the new VFS
H. Peter Anvin [Thu, 13 Aug 2009 04:30:45 +0000 (21:30 -0700)]
iso9660: adjust to the new VFS

I missed converting iso9660 over to the new VFS.  Do it now.
In particular, getfssec now takes a struct file *.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocom32: remove strpcpy() - we already have stpcpy()
H. Peter Anvin [Thu, 13 Aug 2009 04:23:10 +0000 (21:23 -0700)]
com32: remove strpcpy() - we already have stpcpy()

Remove strpcpy(); it is exactly the same thing as stpcpy() which we
already have, and which is more "standard" (in the sense that none of
these are actually standard...)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocore: make FILENAME_MAX common; librarize mangle/unmangle
H. Peter Anvin [Thu, 13 Aug 2009 03:56:46 +0000 (20:56 -0700)]
core: make FILENAME_MAX common; librarize mangle/unmangle

FILENAME_MAX was 2^8 in all variants by now; make it a common define.
Libraries mangle/unmangle; we have generic_mangle_name for Unix-like
filesystems, and unmangle now defaults to simple strcpy.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocore: more filesystem-specific files into subdirectories
H. Peter Anvin [Thu, 13 Aug 2009 03:23:47 +0000 (20:23 -0700)]
core: more filesystem-specific files into subdirectories

Preemptively move filesystem-specific files into core/fs/<fsname> so
we can start trying to pretend to be organized.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocore: VFS cleanups: add a persistent generic struct file
H. Peter Anvin [Wed, 12 Aug 2009 00:25:43 +0000 (17:25 -0700)]
core: VFS cleanups: add a persistent generic struct file

Major cleanups to the VFS layer:
- add a persistent generic "struct file"
- pass "struct file *" to getfssec
- add a close_file method
- use VFS-assigned indicies instead of pointers as file handles.
  This allows the file structures to be allocated from high memory.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoMerge commit 'liu/master' into fsc syslinux-4.00-pre2
H. Peter Anvin [Tue, 11 Aug 2009 20:20:04 +0000 (13:20 -0700)]
Merge commit 'liu/master' into fsc

14 years agopxe: more tweaks to the open (searchdir) routine
H. Peter Anvin [Tue, 11 Aug 2009 20:17:27 +0000 (13:17 -0700)]
pxe: more tweaks to the open (searchdir) routine

More tweaks to the open (searchdir) routine, in particular in the OACK
packet parsing.  From testing it appears substantially more robust
now.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agonetinet/in.h: adjust hton/ntoh macros to be true constants
H. Peter Anvin [Tue, 11 Aug 2009 20:16:13 +0000 (13:16 -0700)]
netinet/in.h: adjust hton/ntoh macros to be true constants

Tweak the hton/ntoh macros so that they are true constants if the
input is a constant expression; this makes them usable in the
preprocessor.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agopxe: clean up C code; reimplement "Plan C"; share PXE API definitions
H. Peter Anvin [Tue, 11 Aug 2009 18:49:04 +0000 (11:49 -0700)]
pxe: clean up C code; reimplement "Plan C"; share PXE API definitions

Minor cleanups to the C code.
Reimplement "Plan C" for finding the entry point.
Share the PXE API definitions between com32 and the core.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoCore:SYSLINUX: make searchdir do work
Liu Aleaxander [Tue, 11 Aug 2009 09:18:38 +0000 (17:18 +0800)]
Core:SYSLINUX: make searchdir do work

well, still get lots of bugs, like when we execute
dir /boot/syslinux
in fact, it will list the file in /boot/ directory but not in /boot/syslinux/

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agoCore:SYSLINUX: fix the vfat_searchdir
Liu Aleaxander [Tue, 11 Aug 2009 06:16:23 +0000 (14:16 +0800)]
Core:SYSLINUX: fix the vfat_searchdir

This makes the searchdir can find a dir; it's also prepared for the readdir function used in rosh

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agocore: remove assembly definition of Files in iso/pxelinux
H. Peter Anvin [Tue, 11 Aug 2009 00:30:25 +0000 (17:30 -0700)]
core: remove assembly definition of Files in iso/pxelinux

Remove the assembly definition of Files in isolinux and pxelinux.
Still to do: remove dependencies on Files living in .bss16 space.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoMCONFIG: update GCCOPT
H. Peter Anvin [Mon, 10 Aug 2009 23:56:06 +0000 (16:56 -0700)]
MCONFIG: update GCCOPT

Add -fwrapv, -freg-struct-return, -fno-exceptions,
-fno-asynchronous-unwind-tables, -fno-strict-aliasing.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocore: add missing (void), drop casts for Files[], cleanups
H. Peter Anvin [Mon, 10 Aug 2009 23:45:44 +0000 (16:45 -0700)]
core: add missing (void), drop casts for Files[], cleanups

Add missing (void) on no-argument functions, drop casts for Files
(it's now a properly typed array), clean up loop forms.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoext2: fix missing (void), use standard form for loop
H. Peter Anvin [Mon, 10 Aug 2009 23:42:53 +0000 (16:42 -0700)]
ext2: fix missing (void), use standard form for loop

Use the standard form for a for loop; add missing (void).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoMerge commit 'liu/master'; fix Files[] definition
H. Peter Anvin [Mon, 10 Aug 2009 23:39:29 +0000 (16:39 -0700)]
Merge commit 'liu/master'; fix Files[] definition

Resolved Conflicts:
core/extlinux.asm
core/ldlinux.asm

Merge in liu's changes, but fix Files[] to be a private structure
inside the filesystem, thus we don't have to worry about the
size of it in the assembly code at all.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocore/diskstart.inc: make the root filesystem a configurable
H. Peter Anvin [Mon, 10 Aug 2009 21:27:21 +0000 (14:27 -0700)]
core/diskstart.inc: make the root filesystem a configurable

Instead of using conditional compilation, just set the root filesystem
type in the assembly stub.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agozlib: remove unused sample programs
H. Peter Anvin [Mon, 10 Aug 2009 18:18:12 +0000 (11:18 -0700)]
zlib: remove unused sample programs

Remove unused sample programs (example.c, minigzip.c); we don' tuse
them and they are just noise.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocore: merge ldlinux.asm and extlinux.asm
H. Peter Anvin [Mon, 10 Aug 2009 02:47:24 +0000 (19:47 -0700)]
core: merge ldlinux.asm and extlinux.asm

ldlinux.asm and extlinux.asm are by now extremely similar.  Merge
them.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agozlib: kill gzio.c
H. Peter Anvin [Sun, 9 Aug 2009 22:52:26 +0000 (15:52 -0700)]
zlib: kill gzio.c

Remove gzio.c, which is a zlib-specific stdio-like interface.  We
implement this in the actual filesystem layer, which is much cleaner.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoMerge branch 'core32' into fsc
H. Peter Anvin [Sun, 9 Aug 2009 21:44:34 +0000 (14:44 -0700)]
Merge branch 'core32' into fsc

14 years agocore: remove hack for dynamic symbol table generation
H. Peter Anvin [Sun, 9 Aug 2009 21:42:50 +0000 (14:42 -0700)]
core: remove hack for dynamic symbol table generation

Kill hack we used to generate a dynamic symbol table.  There is a much
better technique for doing this which is already deployed on the
"dynamic" branch.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoCore:pxelinux: improves the tftp options parsing
Liu Aleaxander [Sun, 9 Aug 2009 07:00:48 +0000 (15:00 +0800)]
Core:pxelinux: improves the tftp options parsing

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agopxe: fix OACK packet handling
Liu Aleaxander [Sun, 9 Aug 2009 06:54:08 +0000 (14:54 +0800)]
pxe: fix OACK packet handling

The current code only works iff the tsize option is set.
This patch fixes the handling of the OACK packet and makes the code
work with all combinations of the tsize and blksize options.

Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
14 years agoMerge branch 'master' into core32
H. Peter Anvin [Sun, 9 Aug 2009 01:48:35 +0000 (18:48 -0700)]
Merge branch 'master' into core32

14 years agoCore: code-clean
Liu Aleaxander [Sat, 8 Aug 2009 09:49:48 +0000 (17:49 +0800)]
Core: code-clean

removes the unused variables and functions

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agoCore: unmangle_name converted
Liu Aleaxander [Sat, 8 Aug 2009 09:39:43 +0000 (17:39 +0800)]
Core: unmangle_name converted

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agoCore:EXTLINUX: fix the bug of open_file_t struct in extlinux
Liu Aleaxander [Sat, 8 Aug 2009 09:03:56 +0000 (17:03 +0800)]
Core:EXTLINUX: fix the bug of open_file_t struct in extlinux

The size of open_file_t structure in extlinux is twice than in the others derivatiives. So we
should cut the MAX_OPEN to half.

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agoCore: move the comman externs to core.h
Liu Aleaxander [Sat, 8 Aug 2009 08:53:24 +0000 (16:53 +0800)]
Core: move the comman externs to core.h

the trackbuf and Files are all uesed in all the four fs, so it would be nice to put the externs
in core.h instead in each c file of the four fs

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agoCore: add _static_ statement to all fs
Liu Aleaxander [Sat, 8 Aug 2009 08:36:26 +0000 (16:36 +0800)]
Core: add _static_ statement to all fs

This well let me far away from some werid trouble

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agocore:PXELINUX: fix the OACK option parsing bug.
Liu Aleaxander [Sat, 8 Aug 2009 08:05:08 +0000 (16:05 +0800)]
core:PXELINUX: fix the OACK option parsing bug.

the current code can just handle one option beacuse I put the do-while loop in the wrong position.

14 years agoCore: get the rid of the ld warnings
Liu Aleaxander [Sat, 8 Aug 2009 07:51:34 +0000 (15:51 +0800)]
Core: get the rid of the ld warnings

we extern the SecPerClust from diskstart.inc and used in fat.c, but we also defined another
SecPerClust in ext2.c. So we should be better to make more things in _static_, just like hpa told.

14 years agoextlinux: add ext4 support to the installer syslinux-4.00-pre1
H. Peter Anvin [Fri, 7 Aug 2009 07:11:21 +0000 (00:11 -0700)]
extlinux: add ext4 support to the installer

The filesystem code now supports ext4, so support it in the installer
as well.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoMakefile: add back the gpxe directory
H. Peter Anvin [Fri, 7 Aug 2009 07:07:02 +0000 (00:07 -0700)]
Makefile: add back the gpxe directory

Add the gpxe directory back into the build.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoMerge branch 'core32' into fsc
H. Peter Anvin [Fri, 7 Aug 2009 07:05:28 +0000 (00:05 -0700)]
Merge branch 'core32' into fsc

Resolved Conflicts:
core/extlinux.asm
core/pxelinux.asm

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoCore:PXELINUX: pxelinux derivative merged succeesfully
Liu Aleaxander [Thu, 6 Aug 2009 09:27:02 +0000 (17:27 +0800)]
Core:PXELINUX: pxelinux derivative merged succeesfully

So, now we have all the fs converted, and the rest is to make it better and more simple

14 years agoCore:PXELINUX: try to merge pxelinux
Liu Aleaxander [Thu, 6 Aug 2009 07:17:48 +0000 (15:17 +0800)]
Core:PXELINUX: try to merge pxelinux

the others Syslinux derivative disabled for now

14 years agohdt: Remove extra more_printf calls
Pierre-Alexandre Meyer [Thu, 6 Aug 2009 04:31:13 +0000 (21:31 -0700)]
hdt: Remove extra more_printf calls

Let's rather use string concatenation.

Reported-by: Shao Miller <Shao.Miller@yrdsb.edu.on.ca>
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
14 years agogpllib: Introduce typedefs for callbacks
Pierre-Alexandre Meyer [Thu, 6 Aug 2009 04:03:04 +0000 (21:03 -0700)]
gpllib: Introduce typedefs for callbacks

typedefs are evil but useful for function pointers as it makes them more
readable and maintainable.

This fixes a bug by the way: we had

   void *callback(struct driveinfo *, struct part_entry *, int, int)

where we should have had

   void (*callback)(struct driveinfo *, struct part_entry *, int, int)

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>