summaryrefslogtreecommitdiff
path: root/core/include
Commit message (Collapse)AuthorAgeFilesLines
* cache, btrfs: Provide a general cached read routineH. Peter Anvin2014-05-261-0/+1
| | | | | | | | btrfs_read() was really just a function to read data linearly while using the metadata cache. Move it to cache.c and rename it cache_read() so other filesystems can make use of it as well. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Centralize shift_is_held(), make it work to force the command linesyslinux-6.03-pre11H. Peter Anvin2014-04-201-0/+9
| | | | | | | Holding down shift is supposed to force a command line unless noescape is provided; make it behave that way. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core: Avoid initializing the cache more than onceRaphael S. Carvalho2014-04-031-0/+1
| | | | | | | | | | Most of file system drivers initialize the cache themselves. The problem is that the same cache could be again initialized later, then invalidating the previous one. This patch fixes this. Problem found while auditing the code. Signed-off-by: Raphael S. Carvalho <raphael.scarv@gmail.com>
* Add filesystem UUID to SYSAPPEND for FATSerj Kalichev2014-03-132-0/+5
| | | | | | | | | | Filesystem UUID shows the partition we boot kernel from. The kernel parameter has format like FSUUID=DA1A-0B2E. The SYSAPPEND bit is 0x40000. Now the FAT only supports FSUUID. The patch is based on 67aaaeeb228. Signed-off-by: Serj Kalichev <serj.kalichev@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Merge branch 'nocomapi'syslinux-6.03-pre7H. Peter Anvin2014-03-032-1/+4
|\
| * bios: Remove shuffle and boot comapi callH. Peter Anvin2014-02-131-1/+0
| | | | | | | | | | | | | | | | Remove the shuffle and boot comapi call. This is the last of the comapi calls left; we should now be able to completely remove the comapi support. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * bios: Remove comapi calls related to the ADVH. Peter Anvin2014-02-131-0/+4
| | | | | | | | | | | | | | | | The only comapi calls left are the ones related to the ADV and to shuffle and boot. Remove the ADV-related ones as part of getting rid of the comapi framework completely. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* | shuffler: Actually get the shuffler size sanelysyslinux-6.03-pre4H. Peter Anvin2014-02-271-1/+7
|/ | | | | | | | | Actually get the shuffler size sanely. At least for now, we are BIOS only, so stub out the functions on EFI (they shouldn't even be compiled for EFI; this stuff should be moved into some kind of BIOS-only directory.) Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* core: don't leak the __lowmem and __bss16 macros to modulesH. Peter Anvin2013-10-172-3/+5
| | | | | | | | | | | The __lowmem and __bss16 macros are only useful in the core itself. Hide them from modules so people don't use them by mistake. extern declarations don't need them (and are safe in modules), they are only necessary at the point of definition (which must be in the core.) Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* Merge branch 'elflink-pxe-fixes-for-mfleming-2' of ↵Matt Fleming2013-09-303-4/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://github.com/geneC/syslinux into firmware Pull various network stack fixes from Gene Cumm and adapt to the 6.xx core_udp_* API, * 'elflink-pxe-fixes-for-mfleming-2' of git://github.com/geneC/syslinux: PXE ISR: Force polling on select hardware WORKAROUND core/lwip: Fix NULL pointer check PXE: use ddprintf macro com32: Define ddprintf() macro PXELINUX: specify PXE/lwIP undiif: show thread of execution on UNDIIF_ID_DEBUG core: dprintf() the banner. PXELINUX: Use sendto() instead of connect()/send()/disconnect() core: make mbox_post()/__sem_down_slow() check if valid core: mbox/semaphore NULL checks core/lwip/undi: Improve UNDIIF_ID_DEBUG messages Conflicts: core/fs/pxe/pxe.c core/fs/pxe/tftp.c core/init.c
| * PXELINUX: Use sendto() instead of connect()/send()/disconnect()Gene Cumm2013-09-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit prevents a race-condition on systems that have functional interrupts (observed with iPXE and select other Dell systems). Without this, the reply packet could be received by the core prior to the disconnect() call, see that it doesn't have a matching PCB (protocol control block, iirc) since the reply has a different far-end UDP port than the original request, and lwIP will discard the packet before PXELINUX can see it. net_core_sendto() instead of net_core_connect() net_core_send() net_core_disconnect() Commit message expanded with Matt Fleming's assistance Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
| * core: mbox/semaphore NULL checksGene Cumm2013-08-032-4/+6
| | | | | | | | | | | | Also set mbox invalid and mbox pointer NULL when free()d Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* | video.h: we need one syslinux_force_text_mode() prototypeMatt Fleming2013-07-261-1/+0
| | | | | | | | | | | | | | | | | | Use the one from syslinux/video.h. This makes it easier to write unit tests for syslinux/load_linux.c without pulling in loads of core definitions from core/include/graphics.h. It can also be argued that syslinux_* symbols should have prototypes in syslinux/*.h files. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | efi: Export __bcopyxx_lenMatt Fleming2013-06-211-1/+1
| | | | | | | | | | | | | | | | We need to provide a __bcopyxx_len symbol for EFI because it's referenced in generic code in libcom32.c32. Without this change, libcom32.c32 will fail to load under EFI. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | efi: provide prototype for load_env32()Matt Fleming2013-06-201-0/+2
| | | | | | | | | | | | | | | | To get rid of the following GCC warning, efi/main.c:1237:2: warning: implicit declaration of function ‘load_env32’ [-Wimplicit-function-declaration] Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | efi: Mark global BIOS-only symbols as __weakMatt Fleming2013-06-191-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately, there are still some references in generic code to symbols that only make sense under BIOS. Use the __weak tag to allow building for EFI without having to declare these symbols. Accessing these __weak symbols under EFI will generate an error at runtime, indicating to the user that they're executing a BIOS code path. The long-term solution is to move these BIOS-specific symbols into core/bios.c or somewhere equally BIOS-centric so that these symbols are no longer global. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | Merge tag 'syslinux-5.11-pre2' into firmwareMatt Fleming2013-06-172-2/+25
|\ \ | |/ | | | | | | | | | | | | syslinux-5.11-pre2 Conflicts: core/elflink/load_env32.c version
| * PATH: use a linked list internallysyslinux-5.11-pre1Matt Fleming2013-06-131-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In retrospect, choosing the colon character as the entry separator for the PATH directive was not a smart move, as that character is also used in TFTP-style paths. This conflict manifests as PXELINUX being unable to find and load files. An example dnsmasq log looks like, dnsmasq-tftp: sent /arch/boot/syslinux/lpxelinux.0 to 192.168.0.90 dnsmasq-tftp: file /arch/ldlinux.c32 not found dnsmasq-tftp: file /arch//ldlinux.c32 not found dnsmasq-tftp: file /arch//boot/isolinux/ldlinux.c32 not found dnsmasq-tftp: file /arch//isolinux/ldlinux.c32 not found dnsmasq-tftp: file /arch//boot/syslinuxldlinux.c32 not found dnsmasq-tftp: sent /arch//boot/syslinux/ldlinux.c32 to 192.168.0.90 dnsmasq-tftp: error 0 No error, file close received from 192.168.0.90 dnsmasq-tftp: failed sending /arch//boot/syslinux/ldlinux.c32 to 192.168.0.90 dnsmasq-tftp: sent /arch/boot/syslinux/archiso.cfg to 192.168.0.90 dnsmasq-tftp: sent /arch/boot/syslinux/whichsys.c32 to 192.168.0.90 dnsmasq-tftp: file /arch/libcom32.c32 not found dnsmasq-tftp: file /arch//libcom32.c32 not found dnsmasq-tftp: file /arch/libcom32.c32 not found dnsmasq-tftp: file /arch//arch//boot/syslinux/libcom32.c32 not found The last line of the log is the indication that there's a problem. Internally, Syslinux adds the location of ldlinux.c32 to PATH by querying the current working directory once ldlinux.c32 is successfully loaded. Under PXELINUX that means the initial PATH string will be, "::/arch/boot/syslinux/" The PATH parsing code doesn't know how to correctly parse the "::" string and hence, the file is searched for relative to the 210 dhcp option directory - /arch/. Implement PATH with a linked list which *greatly* simplifies the path code, and means we no longer have to parse strings backwards and forwards. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * serial: Clean up and abstract handling of serial portsH. Peter Anvin2013-05-311-1/+16
| | | | | | | | | | | | | | | | | | | | | | The special handling of serial ports 0-3 meaning "look in a BIOS table" is at least officially BIOS-specific, so create an inline function and move it to bios.h. While we are at it, make the function look slightly less like converted assembly. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* | efi: Add network supportsyslinux-6.00-pre5Matt Fleming2013-04-231-12/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add TCP and UDP support to the EFI firmware backend. This necessitated moving all tcp functions to a core_tcp_* prefix so that they could be implemented differently for BIOS+lwip and EFI. Unfortunately, the tcp_* prefix is already in use by the lwip code. To maintain symmetry, the UDP functions were also moved from net_core_* to core_udp_*. The net_core API was introduced in 5.x to allow the legacy PXE and lwip stacks to live side by side, and the intention was that net_core_init() would take a protocol argument to build a protocol-specific object. It turned out to be easier to call either udp or tcp functions directly because the semantics of read/write differ between protocols. Booting an IPv4 EFI PXE stack using tftp and http has been tested. There are a couple of TODO items left, o dns resolve code is missing o ftp hasn't been tested Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | Merge tag 'syslinux-5.10-pre2' into for-hpa/elflink/firmwareMatt Fleming2013-03-228-37/+273
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | syslinux-5.10-pre2 Conflicts: NEWS com32/include/netinet/in.h com32/include/sys/cpu.h com32/lib/Makefile core/Makefile core/fs/diskio.c core/fs/pxe/pxe.h core/init.c core/mem/free.c core/mem/malloc.c mk/devel.mk version
| * net: Return of the legacy network stackMatt Fleming2013-03-061-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While it's nice having the shiny new lwIP stack, there is definitely merit in being able to choose between two different network stacks. We want to keep the legacy network stack around as it is known to handle funky BIOS implementations and provides a good reference point when bugs are suspected in the lwIP code. Users now have a choice of .0 files. pxelinux.0 uses the legacy network stack, while lpxelinux.0 uses lwIP. Note that not every protocol is converted to using this new API. The http, ftp and tcp code is still inherently tied to the netconn API, and is only available with lpxelinux.0 and the lwIP stack. It's unlikely that this code will ever be fixed up to work with the legacy network stack. Network stack operations are abstracted behind the net_core_* interface, and each network stack has private data fields contained within a struct net_private. Cc: H. Peter Anvin <hpa@zytor.com> Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: Gene Cumm <gene.cumm@gmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * Merge branch 'lwip' into elflinkMatt Fleming2013-02-267-36/+239
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Welcome to Syslinux 5.10. Conflicts: NEWS com32/lib/Makefile com32/lib/sys/open.c com32/lib/syslinux/ipappend.c com32/modules/Makefile com32/modules/prdhcp.c core/Makefile core/cmdline.inc core/com32.inc core/comboot.inc core/configinit.inc core/fs/chdir.c core/fs/fs.c core/fs/pxe/dnsresolv.c core/fs/pxe/pxe.c core/fs/pxe/pxe.h core/idle.c core/include/ctype.h core/init.inc core/mem/init.c core/parseconfig.inc core/runkernel.inc core/syslinux.ld core/ui.inc doc/comboot.txt version
| | * thread: Add magic number, debugging code, min stack sizeH. Peter Anvin2012-03-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a magic number to the thread control block; this helps check for memory overwrites. Add dprintf()s to the scheduler. Force a minimum stack size. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| | * thread: allow marking invalid; allow for static mboxesH. Peter Anvin2011-10-112-1/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an operation to mark a semaphore or a mailbox invalid (need to be reinitialized); and to test whether or not they are initialized. Allow for static mboxes, that is, not using dynamic memory. Both these changes should allow for the use of non-dynamic allocations in lwIP 1.4 and higher. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| | * pxe: when hooking an interrupt, explicitly enable it at the PICH. Peter Anvin2011-05-091-23/+0
| | | | | | | | | | | | | | | | | | | | | At least gPXE/iPXE apparently enters the NBP with the interrupt line disabled at the PIC; explicitly enable it instead. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| | * core: pass the file flags down through the stackH. Peter Anvin2011-05-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Pass the file flags down through the stack. This allows us to distinguish between open for read, open for write, or opendir in the low-level filesystem functions; this will matter for the PXE methods. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| | * thread: fix warningsH. Peter Anvin2011-05-011-0/+1
| | | | | | | | | | | | | | | | | | Fix set-but-not-used variable warnings and undefined references. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| | * thread: simplify the schedulerH. Peter Anvin2011-04-301-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | need_schedule was no longer used by anything else, and schedule_lock only verified if we were being called from inside sched_hook_func(). Make the localness of this data explicit. While we're at it, call kaboom if we ever find ourselves without a runnable thread (which should not be possible, as the idle thread is not allowed to block.) Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| | * thread: make kill_thread() actually do its jobH. Peter Anvin2011-04-271-1/+11
| | | | | | | | | | | | | | | | | | | | | kill_thread() had been modifying errno(!) as if it had been the return value... in other words, it really did absolutely nothing. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| | * Additional sysappend strings from DMI; pre-bake the http cookiesH. Peter Anvin2011-04-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Add additional sysappend strings from DMI; we may want to add even more but let's think about it first. - Pre-generate http cookies. - Add a "sendcookies" command to mask out some of the information. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| | * Generalize ipappend handling as "sysappend", and move to PM codeH. Peter Anvin2011-04-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generalize the ipappend handling to cover all the derivatives, and rename it "sysappend" ("ipappend" is a valid alias for all derivatives.) Move all the string handling to protected mode. Currently only pxelinux exports strings, but the plan is to change that in the future. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| | * core: remove the .hugebss sectionH. Peter Anvin2011-04-251-6/+0
| | | | | | | | | | | | | | | | | | | | | There are no more users of the .hugebss section, so remove it from existence. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| | * PXE Cleanups, allow for 128 open filesH. Peter Anvin2011-04-251-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Clean up dead code in the PXE stack. The buffer assignment no longer limits the number of open files either, so raise it to something more than reasonable. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| | * pxe: use a separate poll thread instead of using an idle thread hookH. Peter Anvin2011-04-241-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idle thread can never sleep, so it's not really safe to do anything inside it. Instead, run a separate poll thread at low priority; we can also do that to poll the serial console if needed. Overall, the "classic" Syslinux idle handling really should go away and be replaced by the idle thread. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| | * lwip: handle UNDI stacks which need to be polledH. Peter Anvin2011-04-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the UNDI stack reports either IRQ 0 or does NOT report the NDIS IRQ supported flag, then poll the interrupt routine from the idle thread instead. This is somewhat limited; we really should have a chain of idle poll routines to support things like serial console. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| | * thread: thread-switch the real-mode stack, tooH. Peter Anvin2011-04-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When this code was originally written, we didn't have lmalloc(). Now when lmalloc() is implemented, let each real-mode task have its own stack. Note that this means we absolutely have to continue to support the SS != CS, DS model in the real-mode code, which should already be the case, but... Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| | * core: thread: Implement polling for wakeups.Eric W. Biederman2011-04-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For some reason the core_pm_hook is not getting called every time we get an interrupt with the result that in some situations like arping for our neighbours mac address or a tftp transfer we can stall, we never move forward again. The reason for those stalls likely bears more investigating but for now it is sufficient for me to know that they exist and that I can work around them by polling for wakekup conditions everytime we call schedule. That gives us code that works reliably and stays within the letter of the pxe spec. The oddities of the pxelinux core can be ironed out later. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
| | * core: pxe: Improve the situation with installing and uninstalling irq handlersEric W. Biederman2011-04-121-0/+1
| | | | | | | | | | | | Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
| | * core: Add isspace to ctype.hEric W. Biederman2011-04-121-0/+13
| | | | | | | | | | | | | | | | | | This is needed for the http file downloader. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
| | * core thread: Don't include core.h from thread.hEric W. Biederman2011-04-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | core.h brings in a lot of symbols and causes conflicts when included into lwip, in particular conflicts on the symbol lfree. So do the simple thing and simplify what thread.h brings in to reduce the change of symbol conflicts. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
| | * core: Move timer functions into timer.hEric W. Biederman2011-04-092-16/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lwip gets symbol conflicts when we include all of core.h so move the declaration of the timers into their own header so that we can use those declartions in thread.h and so we can use thread.h from lwip without having to deal with symbol conflicts. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
| | * core: Move kaboom into it's own header.Eric W. Biederman2011-04-092-6/+12
| | | | | | | | | | | | | | | | | | This allows kaboom to be used by lwip without having to inclued all of core.h Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
| | * core: thread: add a name fieldH. Peter Anvin2011-04-091-1/+2
| | | | | | | | | | | | | | | | | | Add a name field to struct thread, for debugging's sake. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
| | * core: thread: add static declaration of semaphoresH. Peter Anvin2011-04-091-0/+9
| | | | | | | | | | | | | | | | | | Add the ability to statically declare initialized semaphores. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
| | * thread: add support for locking the schedulerH. Peter Anvin2011-04-092-0/+6
| | | | | | | | | | | | | | | | | | | | | Add support for locking the scheduler; this is needed for the pm return hook to operate properly. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| | * core thread: Rename timeouts pvt to better reflect it's use.Eric W. Biederman2011-04-091-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | lwip needs to find a per thread list of timeouts when it calls sys_arch_thread_timeouts(). Since we support threads we can easily support this extra bit of private data. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
| | * core: thread: add a "timeouts" pointer to the thread structureH. Peter Anvin2011-04-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Add a "timeouts" pointer to the thread structure; this is a private per-thread pointer for the benefit of lwIP. This is ad hoc, but a lot easier than implementing TLS. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| | * core: thread: move most thread state to stack; task switch errnoH. Peter Anvin2011-04-091-5/+1
| | | | | | | | | | | | | | | | | | | | | Move most our thread state to the stack. Task switch the errno variable. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| | * core: thread: merge mbox_post() and mbox_trypost()H. Peter Anvin2011-04-081-0/+4
| | | | | | | | | | | | | | | | | | | | | Merge mbox_post() and mbox_trypost() into a single function with a timeout parameter. Signed-off-by: H. Peter Anvin <hpa@zytor.com>