aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin (Intel) <hpa@zytor.com>2019-02-07 20:05:52 -0800
committerH. Peter Anvin (Intel) <hpa@zytor.com>2019-02-07 20:05:52 -0800
commit458a54133ecdf1685c02294d812cb562fe7bf4c3 (patch)
treef3dc3a87dfdeb5d179e3f4ef73bf74d651136432
parentb40487005223a78c3bb4c300ef6c436b3f6ec1f7 (diff)
downloadsyslinux-458a54133ecdf1685c02294d812cb562fe7bf4c3.tar.gz
syslinux-458a54133ecdf1685c02294d812cb562fe7bf4c3.tar.xz
syslinux-458a54133ecdf1685c02294d812cb562fe7bf4c3.zip
Fix all warnings, and better separate code that should not be mixedsyslinux-6.04-pre3
Clean up a number of warnings in the tree. Refactor especially the core code so we don't end up building a bunch of BIOS-specific code for EFI, and general build cleanups. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
-rw-r--r--com32/Makefile7
-rw-r--r--com32/cmenu/libmenu/menu.c4
-rw-r--r--com32/elflink/ldlinux/chainboot.c2
-rw-r--r--com32/elflink/ldlinux/loadhigh.c4
-rw-r--r--com32/gpllib/dmi/dmi.c2
-rw-r--r--com32/hdt/hdt-cli-kernel.c3
-rw-r--r--com32/include/syslinux/movebits.h2
-rw-r--r--com32/lib/libpng/pngrtran.c2
-rw-r--r--com32/lib/onexit.c18
-rw-r--r--com32/lib/pci/scan.c67
-rw-r--r--com32/lib/sprintf.c3
-rw-r--r--com32/lib/sys/module/x86_64/elf_module.c8
-rw-r--r--com32/lib/sys/vesa/screencpy.c2
-rw-r--r--com32/lib/syslinux/movebits.c34
-rw-r--r--com32/lib/syslinux/shuffle.c10
-rw-r--r--com32/lib/syslinux/zonelist.c2
-rw-r--r--com32/lib/vsprintf.c3
-rw-r--r--com32/libupload/upload_tftp.c2
-rw-r--r--com32/lua/src/cmenu.c1
-rw-r--r--com32/mboot/map.c12
-rw-r--r--com32/mboot/mem.c2
-rw-r--r--com32/modules/pxechn.c4
-rw-r--r--com32/samples/hello.c3
-rw-r--r--core/Makefile156
-rw-r--r--core/bios/adv.inc (renamed from core/adv.inc)0
-rw-r--r--core/bios/bcopy32.inc (renamed from core/bcopy32.inc)0
-rw-r--r--core/bios/bcopyxx.inc (renamed from core/bcopyxx.inc)0
-rw-r--r--core/bios/bios.c (renamed from core/bios.c)0
-rw-r--r--core/bios/bios.inc (renamed from core/bios.inc)0
-rw-r--r--core/bios/call16.c (renamed from core/call16.c)0
-rw-r--r--core/bios/callback.inc (renamed from core/callback.inc)0
-rw-r--r--core/bios/com32.inc (renamed from core/com32.inc)0
-rw-r--r--core/bios/common.inc (renamed from core/common.inc)0
-rw-r--r--core/bios/config.inc (renamed from core/config.inc)0
-rw-r--r--core/bios/conio.c295
-rw-r--r--core/bios/diskboot.inc (renamed from core/diskboot.inc)0
-rw-r--r--core/bios/diskfs.inc (renamed from core/diskfs.inc)0
-rw-r--r--core/bios/diskio_bios.c (renamed from core/fs/diskio_bios.c)0
-rw-r--r--core/bios/diskstart.inc (renamed from core/diskstart.inc)0
-rw-r--r--core/bios/extern.inc (renamed from core/extern.inc)7
-rw-r--r--core/bios/font.c (renamed from core/font.c)0
-rw-r--r--core/bios/graphics.c (renamed from core/graphics.c)0
-rw-r--r--core/bios/head.inc (renamed from core/head.inc)0
-rw-r--r--core/bios/init.inc (renamed from core/init.inc)0
-rw-r--r--core/bios/io.inc (renamed from core/io.inc)0
-rw-r--r--core/bios/isolinux-c.c (renamed from core/isolinux-c.c)0
-rw-r--r--core/bios/isolinux-debug-c.c1
-rw-r--r--core/bios/isolinux-debug.asm (renamed from core/isolinux-debug.asm)0
-rw-r--r--core/bios/isolinux.asm (renamed from core/isolinux.asm)0
-rw-r--r--core/bios/kaboom.c (renamed from core/kaboom.c)0
-rw-r--r--core/bios/kernel.inc (renamed from core/kernel.inc)0
-rw-r--r--core/bios/keywords.inc (renamed from core/keywords.inc)0
-rw-r--r--core/bios/layout.inc (renamed from core/layout.inc)0
-rw-r--r--core/bios/ldlinux-c.c (renamed from core/ldlinux-c.c)0
-rw-r--r--core/bios/ldlinux.asm (renamed from core/ldlinux.asm)0
-rw-r--r--core/bios/legacynet/core.c (renamed from core/legacynet/core.c)2
-rw-r--r--core/bios/legacynet/dnsresolv.c (renamed from core/legacynet/dnsresolv.c)2
-rw-r--r--core/bios/legacynet/idle.c (renamed from core/legacynet/idle.c)2
-rw-r--r--core/bios/legacynet/portnum.c (renamed from core/legacynet/portnum.c)2
-rw-r--r--core/bios/localboot.c (renamed from core/localboot.c)3
-rw-r--r--core/bios/localboot.inc (renamed from core/localboot.inc)0
-rw-r--r--core/bios/lpxelinux-c.c1
-rw-r--r--core/bios/lpxelinux.asm2
-rw-r--r--core/bios/lwip/CHANGELOG (renamed from core/lwip/CHANGELOG)0
-rw-r--r--core/bios/lwip/COPYING (renamed from core/lwip/COPYING)0
-rw-r--r--core/bios/lwip/FILES (renamed from core/lwip/FILES)0
-rw-r--r--core/bios/lwip/README (renamed from core/lwip/README)0
-rw-r--r--core/bios/lwip/UPGRADING (renamed from core/lwip/UPGRADING)0
-rw-r--r--core/bios/lwip/core.c (renamed from core/fs/pxe/core.c)2
-rw-r--r--core/bios/lwip/dnsresolv.c (renamed from core/fs/pxe/dnsresolv.c)2
-rw-r--r--core/bios/lwip/doc/FILES (renamed from core/lwip/doc/FILES)0
-rw-r--r--core/bios/lwip/doc/contrib.txt (renamed from core/lwip/doc/contrib.txt)0
-rw-r--r--core/bios/lwip/doc/rawapi.txt (renamed from core/lwip/doc/rawapi.txt)0
-rw-r--r--core/bios/lwip/doc/savannah.txt (renamed from core/lwip/doc/savannah.txt)0
-rw-r--r--core/bios/lwip/doc/snmp_agent.txt (renamed from core/lwip/doc/snmp_agent.txt)0
-rw-r--r--core/bios/lwip/doc/sys_arch.txt (renamed from core/lwip/doc/sys_arch.txt)0
-rw-r--r--core/bios/lwip/isr.c (renamed from core/fs/pxe/isr.c)15
-rw-r--r--core/bios/lwip/src/FILES (renamed from core/lwip/src/FILES)0
-rw-r--r--core/bios/lwip/src/api/api_lib.c (renamed from core/lwip/src/api/api_lib.c)0
-rw-r--r--core/bios/lwip/src/api/api_msg.c (renamed from core/lwip/src/api/api_msg.c)0
-rw-r--r--core/bios/lwip/src/api/err.c (renamed from core/lwip/src/api/err.c)0
-rw-r--r--core/bios/lwip/src/api/netbuf.c (renamed from core/lwip/src/api/netbuf.c)0
-rw-r--r--core/bios/lwip/src/api/netdb.c (renamed from core/lwip/src/api/netdb.c)0
-rw-r--r--core/bios/lwip/src/api/netifapi.c (renamed from core/lwip/src/api/netifapi.c)0
-rw-r--r--core/bios/lwip/src/api/sockets.c (renamed from core/lwip/src/api/sockets.c)0
-rw-r--r--core/bios/lwip/src/api/tcpip.c (renamed from core/lwip/src/api/tcpip.c)0
-rw-r--r--core/bios/lwip/src/arch/sys_arch.c (renamed from core/lwip/src/arch/sys_arch.c)0
-rw-r--r--core/bios/lwip/src/core/def.c (renamed from core/lwip/src/core/def.c)0
-rw-r--r--core/bios/lwip/src/core/dhcp.c (renamed from core/lwip/src/core/dhcp.c)0
-rw-r--r--core/bios/lwip/src/core/dns.c (renamed from core/lwip/src/core/dns.c)0
-rw-r--r--core/bios/lwip/src/core/init.c (renamed from core/lwip/src/core/init.c)0
-rw-r--r--core/bios/lwip/src/core/ipv4/autoip.c (renamed from core/lwip/src/core/ipv4/autoip.c)0
-rw-r--r--core/bios/lwip/src/core/ipv4/icmp.c (renamed from core/lwip/src/core/ipv4/icmp.c)0
-rw-r--r--core/bios/lwip/src/core/ipv4/igmp.c (renamed from core/lwip/src/core/ipv4/igmp.c)0
-rw-r--r--core/bios/lwip/src/core/ipv4/inet.c (renamed from core/lwip/src/core/ipv4/inet.c)0
-rw-r--r--core/bios/lwip/src/core/ipv4/inet_chksum.c (renamed from core/lwip/src/core/ipv4/inet_chksum.c)0
-rw-r--r--core/bios/lwip/src/core/ipv4/ip.c (renamed from core/lwip/src/core/ipv4/ip.c)0
-rw-r--r--core/bios/lwip/src/core/ipv4/ip_addr.c (renamed from core/lwip/src/core/ipv4/ip_addr.c)0
-rw-r--r--core/bios/lwip/src/core/ipv4/ip_frag.c (renamed from core/lwip/src/core/ipv4/ip_frag.c)0
-rw-r--r--core/bios/lwip/src/core/mem.c (renamed from core/lwip/src/core/mem.c)0
-rw-r--r--core/bios/lwip/src/core/memp.c (renamed from core/lwip/src/core/memp.c)0
-rw-r--r--core/bios/lwip/src/core/netif.c (renamed from core/lwip/src/core/netif.c)0
-rw-r--r--core/bios/lwip/src/core/pbuf.c (renamed from core/lwip/src/core/pbuf.c)0
-rw-r--r--core/bios/lwip/src/core/raw.c (renamed from core/lwip/src/core/raw.c)0
-rw-r--r--core/bios/lwip/src/core/snmp/asn1_dec.c (renamed from core/lwip/src/core/snmp/asn1_dec.c)0
-rw-r--r--core/bios/lwip/src/core/snmp/asn1_enc.c (renamed from core/lwip/src/core/snmp/asn1_enc.c)0
-rw-r--r--core/bios/lwip/src/core/snmp/mib2.c (renamed from core/lwip/src/core/snmp/mib2.c)0
-rw-r--r--core/bios/lwip/src/core/snmp/mib_structs.c (renamed from core/lwip/src/core/snmp/mib_structs.c)0
-rw-r--r--core/bios/lwip/src/core/snmp/msg_in.c (renamed from core/lwip/src/core/snmp/msg_in.c)0
-rw-r--r--core/bios/lwip/src/core/snmp/msg_out.c (renamed from core/lwip/src/core/snmp/msg_out.c)0
-rw-r--r--core/bios/lwip/src/core/stats.c (renamed from core/lwip/src/core/stats.c)0
-rw-r--r--core/bios/lwip/src/core/sys.c (renamed from core/lwip/src/core/sys.c)0
-rw-r--r--core/bios/lwip/src/core/tcp.c (renamed from core/lwip/src/core/tcp.c)0
-rw-r--r--core/bios/lwip/src/core/tcp_in.c (renamed from core/lwip/src/core/tcp_in.c)0
-rw-r--r--core/bios/lwip/src/core/tcp_out.c (renamed from core/lwip/src/core/tcp_out.c)0
-rw-r--r--core/bios/lwip/src/core/timers.c (renamed from core/lwip/src/core/timers.c)0
-rw-r--r--core/bios/lwip/src/core/udp.c (renamed from core/lwip/src/core/udp.c)0
-rw-r--r--core/bios/lwip/src/include/arch/cc.h (renamed from core/lwip/src/include/arch/cc.h)0
-rw-r--r--core/bios/lwip/src/include/arch/perf.h (renamed from core/lwip/src/include/arch/perf.h)0
-rw-r--r--core/bios/lwip/src/include/arch/sys_arch.h (renamed from core/lwip/src/include/arch/sys_arch.h)0
-rw-r--r--core/bios/lwip/src/include/ipv4/lwip/autoip.h (renamed from core/lwip/src/include/ipv4/lwip/autoip.h)0
-rw-r--r--core/bios/lwip/src/include/ipv4/lwip/icmp.h (renamed from core/lwip/src/include/ipv4/lwip/icmp.h)0
-rw-r--r--core/bios/lwip/src/include/ipv4/lwip/igmp.h (renamed from core/lwip/src/include/ipv4/lwip/igmp.h)0
-rw-r--r--core/bios/lwip/src/include/ipv4/lwip/inet.h (renamed from core/lwip/src/include/ipv4/lwip/inet.h)0
-rw-r--r--core/bios/lwip/src/include/ipv4/lwip/inet_chksum.h (renamed from core/lwip/src/include/ipv4/lwip/inet_chksum.h)0
-rw-r--r--core/bios/lwip/src/include/ipv4/lwip/ip.h (renamed from core/lwip/src/include/ipv4/lwip/ip.h)0
-rw-r--r--core/bios/lwip/src/include/ipv4/lwip/ip_addr.h (renamed from core/lwip/src/include/ipv4/lwip/ip_addr.h)0
-rw-r--r--core/bios/lwip/src/include/ipv4/lwip/ip_frag.h (renamed from core/lwip/src/include/ipv4/lwip/ip_frag.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/api.h (renamed from core/lwip/src/include/lwip/api.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/api_msg.h (renamed from core/lwip/src/include/lwip/api_msg.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/arch.h (renamed from core/lwip/src/include/lwip/arch.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/debug.h (renamed from core/lwip/src/include/lwip/debug.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/def.h (renamed from core/lwip/src/include/lwip/def.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/dhcp.h (renamed from core/lwip/src/include/lwip/dhcp.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/dns.h (renamed from core/lwip/src/include/lwip/dns.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/err.h (renamed from core/lwip/src/include/lwip/err.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/init.h (renamed from core/lwip/src/include/lwip/init.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/mem.h (renamed from core/lwip/src/include/lwip/mem.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/memp.h (renamed from core/lwip/src/include/lwip/memp.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/memp_std.h (renamed from core/lwip/src/include/lwip/memp_std.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/netbuf.h (renamed from core/lwip/src/include/lwip/netbuf.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/netdb.h (renamed from core/lwip/src/include/lwip/netdb.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/netif.h (renamed from core/lwip/src/include/lwip/netif.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/netifapi.h (renamed from core/lwip/src/include/lwip/netifapi.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/opt.h (renamed from core/lwip/src/include/lwip/opt.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/pbuf.h (renamed from core/lwip/src/include/lwip/pbuf.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/raw.h (renamed from core/lwip/src/include/lwip/raw.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/sio.h (renamed from core/lwip/src/include/lwip/sio.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/snmp.h (renamed from core/lwip/src/include/lwip/snmp.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/snmp_asn1.h (renamed from core/lwip/src/include/lwip/snmp_asn1.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/snmp_msg.h (renamed from core/lwip/src/include/lwip/snmp_msg.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/snmp_structs.h (renamed from core/lwip/src/include/lwip/snmp_structs.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/sockets.h (renamed from core/lwip/src/include/lwip/sockets.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/stats.h (renamed from core/lwip/src/include/lwip/stats.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/sys.h (renamed from core/lwip/src/include/lwip/sys.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/tcp.h (renamed from core/lwip/src/include/lwip/tcp.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/tcp_impl.h (renamed from core/lwip/src/include/lwip/tcp_impl.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/tcpip.h (renamed from core/lwip/src/include/lwip/tcpip.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/timers.h (renamed from core/lwip/src/include/lwip/timers.h)0
-rw-r--r--core/bios/lwip/src/include/lwip/udp.h (renamed from core/lwip/src/include/lwip/udp.h)0
-rw-r--r--core/bios/lwip/src/include/lwipopts.h (renamed from core/lwip/src/include/lwipopts.h)0
-rw-r--r--core/bios/lwip/src/include/netif/etharp.h (renamed from core/lwip/src/include/netif/etharp.h)0
-rw-r--r--core/bios/lwip/src/include/netif/ppp_oe.h (renamed from core/lwip/src/include/netif/ppp_oe.h)0
-rw-r--r--core/bios/lwip/src/include/netif/slipif.h (renamed from core/lwip/src/include/netif/slipif.h)0
-rw-r--r--core/bios/lwip/src/netif/FILES (renamed from core/lwip/src/netif/FILES)0
-rw-r--r--core/bios/lwip/src/netif/etharp.c (renamed from core/lwip/src/netif/etharp.c)0
-rw-r--r--core/bios/lwip/src/netif/ethernetif.c (renamed from core/lwip/src/netif/ethernetif.c)0
-rw-r--r--core/bios/lwip/src/netif/ppp/auth.c (renamed from core/lwip/src/netif/ppp/auth.c)0
-rw-r--r--core/bios/lwip/src/netif/ppp/auth.h (renamed from core/lwip/src/netif/ppp/auth.h)0
-rw-r--r--core/bios/lwip/src/netif/ppp/chap.c (renamed from core/lwip/src/netif/ppp/chap.c)0
-rw-r--r--core/bios/lwip/src/netif/ppp/chap.h (renamed from core/lwip/src/netif/ppp/chap.h)0
-rw-r--r--core/bios/lwip/src/netif/ppp/chpms.c (renamed from core/lwip/src/netif/ppp/chpms.c)0
-rw-r--r--core/bios/lwip/src/netif/ppp/chpms.h (renamed from core/lwip/src/netif/ppp/chpms.h)0
-rw-r--r--core/bios/lwip/src/netif/ppp/fsm.c (renamed from core/lwip/src/netif/ppp/fsm.c)0
-rw-r--r--core/bios/lwip/src/netif/ppp/fsm.h (renamed from core/lwip/src/netif/ppp/fsm.h)0
-rw-r--r--core/bios/lwip/src/netif/ppp/ipcp.c (renamed from core/lwip/src/netif/ppp/ipcp.c)0
-rw-r--r--core/bios/lwip/src/netif/ppp/ipcp.h (renamed from core/lwip/src/netif/ppp/ipcp.h)0
-rw-r--r--core/bios/lwip/src/netif/ppp/lcp.c (renamed from core/lwip/src/netif/ppp/lcp.c)0
-rw-r--r--core/bios/lwip/src/netif/ppp/lcp.h (renamed from core/lwip/src/netif/ppp/lcp.h)0
-rw-r--r--core/bios/lwip/src/netif/ppp/magic.c (renamed from core/lwip/src/netif/ppp/magic.c)0
-rw-r--r--core/bios/lwip/src/netif/ppp/magic.h (renamed from core/lwip/src/netif/ppp/magic.h)0
-rw-r--r--core/bios/lwip/src/netif/ppp/md5.c (renamed from core/lwip/src/netif/ppp/md5.c)0
-rw-r--r--core/bios/lwip/src/netif/ppp/md5.h (renamed from core/lwip/src/netif/ppp/md5.h)0
-rw-r--r--core/bios/lwip/src/netif/ppp/pap.c (renamed from core/lwip/src/netif/ppp/pap.c)0
-rw-r--r--core/bios/lwip/src/netif/ppp/pap.h (renamed from core/lwip/src/netif/ppp/pap.h)0
-rw-r--r--core/bios/lwip/src/netif/ppp/ppp.c (renamed from core/lwip/src/netif/ppp/ppp.c)0
-rw-r--r--core/bios/lwip/src/netif/ppp/ppp.h (renamed from core/lwip/src/netif/ppp/ppp.h)0
-rw-r--r--core/bios/lwip/src/netif/ppp/ppp_oe.c (renamed from core/lwip/src/netif/ppp/ppp_oe.c)0
-rw-r--r--core/bios/lwip/src/netif/ppp/pppdebug.h (renamed from core/lwip/src/netif/ppp/pppdebug.h)0
-rw-r--r--core/bios/lwip/src/netif/ppp/randm.c (renamed from core/lwip/src/netif/ppp/randm.c)0
-rw-r--r--core/bios/lwip/src/netif/ppp/randm.h (renamed from core/lwip/src/netif/ppp/randm.h)0
-rw-r--r--core/bios/lwip/src/netif/ppp/vj.c (renamed from core/lwip/src/netif/ppp/vj.c)0
-rw-r--r--core/bios/lwip/src/netif/ppp/vj.h (renamed from core/lwip/src/netif/ppp/vj.h)0
-rw-r--r--core/bios/lwip/src/netif/slipif.c (renamed from core/lwip/src/netif/slipif.c)0
-rw-r--r--core/bios/lwip/src/netif/undiif.c (renamed from core/lwip/src/netif/undiif.c)2
-rw-r--r--core/bios/lwip/tcp.c (renamed from core/fs/pxe/tcp.c)2
-rw-r--r--core/bios/lwip/thread/exit_thread.c (renamed from core/thread/exit_thread.c)0
-rw-r--r--core/bios/lwip/thread/idle_thread.c (renamed from core/thread/idle_thread.c)0
-rw-r--r--core/bios/lwip/thread/kill_thread.c (renamed from core/thread/kill_thread.c)0
-rw-r--r--core/bios/lwip/thread/mbox.c (renamed from core/thread/mbox.c)0
-rw-r--r--core/bios/lwip/thread/root_thread.c (renamed from core/thread/root_thread.c)0
-rw-r--r--core/bios/lwip/thread/schedule.c (renamed from core/thread/schedule.c)6
-rw-r--r--core/bios/lwip/thread/sem_asm.S (renamed from core/thread/sem_asm.S)0
-rw-r--r--core/bios/lwip/thread/semaphore.c (renamed from core/thread/semaphore.c)0
-rw-r--r--core/bios/lwip/thread/start_thread.c (renamed from core/thread/start_thread.c)0
-rw-r--r--core/bios/lwip/thread/thread_asm.S (renamed from core/thread/thread_asm.S)0
-rw-r--r--core/bios/lwip/thread/timeout.c (renamed from core/thread/timeout.c)0
-rw-r--r--core/bios/lzo/enter.ash (renamed from core/lzo/enter.ash)0
-rw-r--r--core/bios/lzo/leave.ash (renamed from core/lzo/leave.ash)0
-rw-r--r--core/bios/lzo/lzo1c_d.ash (renamed from core/lzo/lzo1c_d.ash)0
-rw-r--r--core/bios/lzo/lzo1f_d.ash (renamed from core/lzo/lzo1f_d.ash)0
-rw-r--r--core/bios/lzo/lzo1x_d.ash (renamed from core/lzo/lzo1x_d.ash)0
-rw-r--r--core/bios/lzo/lzo1x_f2.S (renamed from core/lzo/lzo1x_f2.S)0
-rw-r--r--core/bios/lzo/lzo_asm.h (renamed from core/lzo/lzo_asm.h)0
-rw-r--r--core/bios/macros.inc (renamed from core/macros.inc)0
-rw-r--r--core/bios/null_thread.c18
-rw-r--r--core/bios/plaincon.c (renamed from core/plaincon.c)0
-rw-r--r--core/bios/pm.inc (renamed from core/pm.inc)0
-rw-r--r--core/bios/pmcall.inc (renamed from core/pmcall.inc)0
-rw-r--r--core/bios/prefix.inc (renamed from core/prefix.inc)0
-rw-r--r--core/bios/pxe.inc (renamed from core/pxe.inc)0
-rw-r--r--core/bios/pxe/bios.c (renamed from core/fs/pxe/bios.c)30
-rw-r--r--core/bios/pxe/pxeboot.c (renamed from core/pxeboot.c)2
-rw-r--r--core/bios/pxeisr.inc (renamed from core/pxeisr.inc)0
-rw-r--r--core/bios/pxelinux-c.c (renamed from core/pxelinux-c.c)0
-rw-r--r--core/bios/pxelinux.asm2
-rw-r--r--core/bios/pxelinux.inc (renamed from core/pxelinux.asm)5
-rw-r--r--core/bios/rawcon.c (renamed from core/rawcon.c)0
-rw-r--r--core/bios/regdump.inc (renamed from core/regdump.inc)0
-rw-r--r--core/bios/rllpack.c (renamed from core/rllpack.c)0
-rw-r--r--core/bios/serirq.c (renamed from core/serirq.c)0
-rw-r--r--core/bios/stack.inc (renamed from core/stack.inc)0
-rw-r--r--core/bios/strcpy.inc (renamed from core/strcpy.inc)0
-rw-r--r--core/bios/syslinux.ld (renamed from core/i386/syslinux.ld)0
-rw-r--r--core/bios/timer.inc (renamed from core/timer.inc)0
-rw-r--r--core/bios/tracers.inc (renamed from core/tracers.inc)0
-rw-r--r--core/bios/writedec.inc (renamed from core/writedec.inc)0
-rw-r--r--core/bios/writehex.inc (renamed from core/writehex.inc)0
-rw-r--r--core/conio.c265
-rw-r--r--core/elflink/elfutils.h18
-rw-r--r--core/fs/ext2/ext2.c2
-rw-r--r--core/fs/ntfs/ntfs.c2
-rw-r--r--core/fs/ntfs/ntfs.h3
-rw-r--r--core/fs/pxe/dhcp_option.c5
-rw-r--r--core/fs/pxe/ftp.c2
-rw-r--r--core/fs/pxe/ftp_readdir.c2
-rw-r--r--core/fs/pxe/gpxeurl.c11
-rw-r--r--core/fs/pxe/http.c2
-rw-r--r--core/fs/pxe/http_readdir.c2
-rw-r--r--core/fs/pxe/idle.c10
-rw-r--r--core/fs/pxe/pxe.c29
-rw-r--r--core/fs/pxe/tftp.c2
-rw-r--r--core/include/core_pxe.h (renamed from core/fs/pxe/pxe.h)0
-rw-r--r--core/strcasecmp.c11
-rw-r--r--core/tests/hello.c (renamed from core/hello.c)0
-rw-r--r--diag/geodsp/Makefile4
-rw-r--r--efi/Makefile25
-rw-r--r--efi/main.c11
-rw-r--r--efi/pxe.c2
-rw-r--r--efi/tcp.c2
-rw-r--r--efi/udp.c2
-rw-r--r--mk/syslinux.mk11
262 files changed, 587 insertions, 592 deletions
diff --git a/com32/Makefile b/com32/Makefile
index 5efda1ce..1aed8c8c 100644
--- a/com32/Makefile
+++ b/com32/Makefile
@@ -1,5 +1,10 @@
SUBDIRS = tools lib libutil gpllib libupload elflink/ldlinux modules mboot \
- menu samples elflink rosh cmenu hdt gfxboot sysdump lua/src chain
+ menu samples elflink rosh cmenu lua/src
+
+ifneq ($(FWCLASS),EFI)
+# These tools are no applicable to EFI, or need serious porting
+SUBDIRS += hdt gfxboot sysdump chain
+endif
.PHONY: subdirs $(SUBDIRS)
subdirs: $(SUBDIRS)
diff --git a/com32/cmenu/libmenu/menu.c b/com32/cmenu/libmenu/menu.c
index 9b1e7ad0..7cd568aa 100644
--- a/com32/cmenu/libmenu/menu.c
+++ b/com32/cmenu/libmenu/menu.c
@@ -481,8 +481,8 @@ static pt_menuitem getmenuoption(pt_menu menu, uchar top, uchar left, uchar star
if (tmp < curr)
first = calc_first_early(menu, tmp);
curr = tmp;
- } else {
- if (ms->keys_handler) // Call extra keys handler
+ } else if (ms->keys_handler) {
+ // Call extra keys handler
ms->keys_handler(ms, menu->items[curr], asc);
/* The handler may have changed the UI, reset it on exit */
diff --git a/com32/elflink/ldlinux/chainboot.c b/com32/elflink/ldlinux/chainboot.c
index 27d4618c..1b9217f5 100644
--- a/com32/elflink/ldlinux/chainboot.c
+++ b/com32/elflink/ldlinux/chainboot.c
@@ -61,7 +61,7 @@ void chainboot_file(const char *file, uint32_t type)
reg.eax.l = max;
reg.ebx.l = 0;
reg.edx.w[0] = 0;
- reg.edi.l = (uint32_t)buf;
+ reg.edi.l = (uintptr_t)buf;
reg.ebp.l = -1; /* XXX: limit? */
reg.esi.w[0] = rv;
diff --git a/com32/elflink/ldlinux/loadhigh.c b/com32/elflink/ldlinux/loadhigh.c
index 0f2f8428..a13d58ff 100644
--- a/com32/elflink/ldlinux/loadhigh.c
+++ b/com32/elflink/ldlinux/loadhigh.c
@@ -54,8 +54,8 @@ void pm_load_high(com32sys_t *regs)
bytes = regs->eax.l;
zero_mask = regs->edx.w[0];
- buf = (char *)regs->edi.l;
- limit = (char *)(regs->ebp.l & ~zero_mask);
+ buf = (char *)(uintptr_t)regs->edi.l;
+ limit = (char *)(uintptr_t)(regs->ebp.l & ~zero_mask);
file = handle_to_file(regs->esi.w[0]);
fs = file->fs;
diff --git a/com32/gpllib/dmi/dmi.c b/com32/gpllib/dmi/dmi.c
index 7613383f..b94a71fb 100644
--- a/com32/gpllib/dmi/dmi.c
+++ b/com32/gpllib/dmi/dmi.c
@@ -1009,7 +1009,7 @@ void parse_dmitable(s_dmi * dmi)
int i = 0;
uint8_t *data = NULL;
uint8_t buf[dmi->dmitable.len];
- memcpy(buf, (int *)dmi->dmitable.base, sizeof(uint8_t) * dmi->dmitable.len);
+ memcpy(buf, (uint8_t *)(uintptr_t)dmi->dmitable.base, dmi->dmitable.len);
data = buf;
dmi->memory_count = 0;
while (i < dmi->dmitable.num && data + 4 <= buf + dmi->dmitable.len) { /* 4 is the length of an SMBIOS structure header */
diff --git a/com32/hdt/hdt-cli-kernel.c b/com32/hdt/hdt-cli-kernel.c
index 0160bed9..9b7ff49b 100644
--- a/com32/hdt/hdt-cli-kernel.c
+++ b/com32/hdt/hdt-cli-kernel.c
@@ -34,6 +34,9 @@
#include "hdt-cli.h"
#include "hdt-common.h"
+/* False positive warning in this file */
+#pragma GCC diagnostic ignored "-Wsizeof-pointer-memaccess"
+
void main_show_kernel(int argc __unused, char **argv __unused,
struct s_hardware *hardware)
{
diff --git a/com32/include/syslinux/movebits.h b/com32/include/syslinux/movebits.h
index 4a4ce9ef..4f8392f3 100644
--- a/com32/include/syslinux/movebits.h
+++ b/com32/include/syslinux/movebits.h
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdbool.h>
-typedef uint32_t addr_t;
+typedef uintptr_t addr_t;
/*
* A syslinux_movelist is a linked list of move operations. The ordering
diff --git a/com32/lib/libpng/pngrtran.c b/com32/lib/libpng/pngrtran.c
index ccc58ce6..f8dcccf1 100644
--- a/com32/lib/libpng/pngrtran.c
+++ b/com32/lib/libpng/pngrtran.c
@@ -4215,6 +4215,8 @@ png_do_expand_palette(png_structrp png_ptr, png_row_infop row_info,
png_uint_32 i;
png_uint_32 row_width=row_info->width;
+ (void)png_ptr;
+
png_debug(1, "in png_do_expand_palette");
if (row_info->color_type == PNG_COLOR_TYPE_PALETTE)
diff --git a/com32/lib/onexit.c b/com32/lib/onexit.c
index 272f8f1c..8c45e3b4 100644
--- a/com32/lib/onexit.c
+++ b/com32/lib/onexit.c
@@ -4,21 +4,9 @@
#include <stdlib.h>
#include <unistd.h>
+#include <sys/module.h>
#include "atexit.h"
-static struct atexit *__atexit_list;
-
-static __noreturn on_exit_exit(int rv)
-{
- struct atexit *ap;
-
- for (ap = __atexit_list; ap; ap = ap->next) {
- ap->fctn(rv, ap->arg); /* This assumes extra args are harmless */
- }
-
- _exit(rv);
-}
-
int on_exit(void (*fctn) (int, void *), void *arg)
{
struct atexit *as = malloc(sizeof(struct atexit));
@@ -29,8 +17,8 @@ int on_exit(void (*fctn) (int, void *), void *arg)
as->fctn = fctn;
as->arg = arg;
- as->next = __atexit_list;
- __atexit_list = as;
+ as->next = __syslinux_current->u.x.atexit_list;
+ __syslinux_current->u.x.atexit_list = as;
return 0;
}
diff --git a/com32/lib/pci/scan.c b/com32/lib/pci/scan.c
index 20a3e2a6..12301277 100644
--- a/com32/lib/pci/scan.c
+++ b/com32/lib/pci/scan.c
@@ -650,46 +650,45 @@ int get_module_name_from_alias(struct pci_domain *domain, char *modules_alias_pa
/* looking for the next field */
result = strtok(line+strlen("alias pci:v"), delims);
- while( result != NULL ) {
- if (field==0) {
-
- /* Searching for the vendor separator*/
- char *temp = strstr(result,"d");
- if (temp != NULL) {
- strlcpy(vendor_id,result,temp-result);
- result+=strlen(vendor_id)+1;
- }
+ while (result) {
+ if (!field) {
+ /* Searching for the vendor separator*/
+ char *temp = strstr(result,"d");
+ if (temp != NULL) {
+ strlcpy(vendor_id,result,temp-result);
+ result+=strlen(vendor_id)+1;
+ }
- /* Searching for the product separator*/
- temp = strstr(result,"sv");
- if (temp != NULL) {
- strlcpy(product_id,result,temp-result);
- result+=strlen(product_id)+1;
- }
+ /* Searching for the product separator*/
+ temp = strstr(result,"sv");
+ if (temp != NULL) {
+ strlcpy(product_id,result,temp-result);
+ result+=strlen(product_id)+1;
+ }
- /* Searching for the sub vendor separator*/
- temp = strstr(result,"sd");
- if (temp != NULL) {
- strlcpy(sub_vendor_id,result,temp-result);
- result+=strlen(sub_vendor_id)+1;
- }
+ /* Searching for the sub vendor separator*/
+ temp = strstr(result,"sd");
+ if (temp != NULL) {
+ strlcpy(sub_vendor_id,result,temp-result);
+ result+=strlen(sub_vendor_id)+1;
+ }
- /* Searching for the sub product separator*/
- temp = strstr(result,"bc");
- if (temp != NULL) {
- strlcpy(sub_product_id,result,temp-result);
- result+=strlen(sub_product_id)+1;
- }
- /* That's the module name */
- } else if ((strlen(result)>2) &&
- (result[0]==0x20))
- strcpy(module_name,result+1);
- /* We have to replace \n by \0*/
- module_name[strlen(module_name)-1]='\0';
+ /* Searching for the sub product separator*/
+ temp = strstr(result,"bc");
+ if (temp != NULL) {
+ strlcpy(sub_product_id,result,temp-result);
+ result+=strlen(sub_product_id)+1;
+ }
+ } else if (strlen(result) > 2 && result[0] == ' ') {
+ /* That is the module name */
+ strcpy(module_name,result+1);
+ /* We have to replace \n by \0*/
+ module_name[strlen(module_name)-1] = '\0';
+ }
field++;
/* Searching the next field */
- result = strtok( NULL, delims );
+ result = strtok(NULL, delims);
}
/* Now we have extracted informations from the modules.alias
diff --git a/com32/lib/sprintf.c b/com32/lib/sprintf.c
index 3c328410..d00274e0 100644
--- a/com32/lib/sprintf.c
+++ b/com32/lib/sprintf.c
@@ -4,6 +4,7 @@
#include <stdio.h>
#include <unistd.h>
+#include <limits.h>
int sprintf(char *buffer, const char *format, ...)
{
@@ -11,7 +12,7 @@ int sprintf(char *buffer, const char *format, ...)
int rv;
va_start(ap, format);
- rv = vsnprintf(buffer, ~(size_t) 0, format, ap);
+ rv = vsnprintf(buffer, INT_MAX, format, ap);
va_end(ap);
return rv;
diff --git a/com32/lib/sys/module/x86_64/elf_module.c b/com32/lib/sys/module/x86_64/elf_module.c
index dd24bd12..aa89d928 100644
--- a/com32/lib/sys/module/x86_64/elf_module.c
+++ b/com32/lib/sys/module/x86_64/elf_module.c
@@ -241,7 +241,7 @@ int perform_relocation(struct elf_module *module, Elf_Rel *rel) {
*dest += sym_addr;
break;
case R_X86_64_PC32:
- *dest += sym_addr - (Elf32_Addr)dest;
+ *(uint32_t *)dest += sym_addr - (Elf64_Addr)dest;
break;
case R_X86_64_COPY:
if (sym_addr > 0) {
@@ -338,7 +338,7 @@ int resolve_symbols(struct elf_module *module) {
if (rel_size > 0) {
// Process standard relocations
for (i = 0; i < rel_size/rel_entry; i++) {
- crt_rel = (Elf64_Rel*)(rel + i*rel_entry);
+ crt_rel = (Elf64_Rel*)((char *)rel + i*rel_entry);
res = perform_relocation(module, crt_rel);
@@ -351,7 +351,7 @@ int resolve_symbols(struct elf_module *module) {
if (rela_size > 0) {
// Process standard relocations
for (i = 0; i < rela_size/rela_entry; i++) {
- crt_rel = (Elf64_Rel*)(rel + i*rela_entry);
+ crt_rel = (Elf64_Rel*)((char *)rel + i*rela_entry);
res = perform_relocation(module, crt_rel);
@@ -367,7 +367,7 @@ int resolve_symbols(struct elf_module *module) {
//for (i = 0; i < plt_rel_size/sizeof(Elf64_Rel); i++) {
for (i = 0; i < plt_rel_size/rela_entry; i++) {
//crt_rel = (Elf64_Rel*)(plt_rel + i*sizeof(Elf64_Rel));
- crt_rel = (Elf64_Rel*)(plt_rel + i*rela_entry);
+ crt_rel = (Elf64_Rel*)((char *)plt_rel + i*rela_entry);
res = perform_relocation(module, crt_rel);
diff --git a/com32/lib/sys/vesa/screencpy.c b/com32/lib/sys/vesa/screencpy.c
index d78109bc..bc53b5b5 100644
--- a/com32/lib/sys/vesa/screencpy.c
+++ b/com32/lib/sys/vesa/screencpy.c
@@ -59,7 +59,7 @@ void __vesacon_init_copy_to_screen(void)
winn = 1;
wi.win_num = winn;
- wi.win_base = (char *)(mi->win_seg[winn] << 4);
+ wi.win_base = (char *)(uintptr_t)(mi->win_seg[winn] << 4);
wi.win_size = mi->win_size << 10;
wi.win_gshift = ilog2(mi->win_grain) + 10;
wi.win_pos = -1; /* Undefined position */
diff --git a/com32/lib/syslinux/movebits.c b/com32/lib/syslinux/movebits.c
index 24cb74ee..03758c98 100644
--- a/com32/lib/syslinux/movebits.c
+++ b/com32/lib/syslinux/movebits.c
@@ -152,7 +152,7 @@ static const struct syslinux_memmap *is_free_zone(const struct syslinux_memmap
{
addr_t last, llast;
- dprintf("f: 0x%08x bytes at 0x%08x\n", len, start);
+ dprintf("f: 0x%08zx bytes at 0x%08zx\n", len, start);
last = start + len - 1;
@@ -238,11 +238,11 @@ static void shuffle_dealias(struct syslinux_movelist **fraglist,
*/
mpp = fraglist;
while ((mp = *mpp)) {
- dprintf("mp -> (%#x,%#x,%#x)\n", mp->dst, mp->src, mp->len);
+ dprintf("mp -> (%#zx,%#zx,%#zx)\n", mp->dst, mp->src, mp->len);
ps = mp->src;
pe = mp->src + mp->len - 1;
for (mx = *fraglist; mx != mp; mx = mx->next) {
- dprintf("mx -> (%#x,%#x,%#x)\n", mx->dst, mx->src, mx->len);
+ dprintf("mx -> (%#zx,%#zx,%#zx)\n", mx->dst, mx->src, mx->len);
/*
* If there is any overlap between mx and mp, mp should be
* modified and possibly split.
@@ -250,7 +250,7 @@ static void shuffle_dealias(struct syslinux_movelist **fraglist,
xs = mx->src;
xe = mx->src + mx->len - 1;
- dprintf("?: %#x..%#x (inside %#x..%#x)\n", ps, pe, xs, xe);
+ dprintf("?: %#zx..%#zx (inside %#zx..%#zx)\n", ps, pe, xs, xe);
if (pe <= xs || ps >= xe)
continue; /* No overlap */
@@ -282,7 +282,7 @@ static void shuffle_dealias(struct syslinux_movelist **fraglist,
assert(ps >= xs && pe <= xe);
- dprintf("Overlap: %#x..%#x (inside %#x..%#x)\n", ps, pe, xs, xe);
+ dprintf("Overlap: %#zx..%#zx (inside %#zx..%#zx)\n", ps, pe, xs, xe);
mp->src = mx->dst + (ps - xs);
mp->next = *postcopy;
@@ -335,7 +335,7 @@ move_chunk(struct syslinux_movelist ***moves,
copydst = f->dst;
copysrc = f->src;
- dprintf("Q: copylen = 0x%08x, needlen = 0x%08x\n", copylen, needlen);
+ dprintf("Q: copylen = 0x%08zx, needlen = 0x%08zx\n", copylen, needlen);
if (copylen < needlen) {
if (reverse) {
@@ -343,7 +343,7 @@ move_chunk(struct syslinux_movelist ***moves,
copysrc += (f->len - copylen);
}
- dprintf("X: 0x%08x bytes at 0x%08x -> 0x%08x\n",
+ dprintf("X: 0x%08zx bytes at 0x%08zx -> 0x%08zx\n",
copylen, copysrc, copydst);
/* Didn't get all we wanted, so we have to split the chunk */
@@ -352,7 +352,8 @@ move_chunk(struct syslinux_movelist ***moves,
}
mv = new_movelist(f->dst, f->src, f->len);
- dprintf("A: 0x%08x bytes at 0x%08x -> 0x%08x\n", mv->len, mv->src, mv->dst);
+ dprintf("A: 0x%08zx bytes at 0x%08zx -> 0x%08zx\n",
+ mv->len, mv->src, mv->dst);
**moves = mv;
*moves = &mv->next;
@@ -368,7 +369,8 @@ move_chunk(struct syslinux_movelist ***moves,
freebase = f->dst + f->len;
}
- dprintf("F: 0x%08x bytes at 0x%08x\n", freelen, freebase);
+ dprintf("F: 0x%08zx bytes at 0x%08zx\n",
+ freelen, freebase);
add_freelist(mmap, freebase, freelen, SMT_FREE);
@@ -472,7 +474,7 @@ nomem:
if (is_free_zone(mmap, needbase, needlen)) {
fp = op, f = o;
- dprintf("!: 0x%08x bytes at 0x%08x -> 0x%08x\n",
+ dprintf("!: 0x%08zx bytes at 0x%08zx -> 0x%08zx\n",
f->len, f->src, f->dst);
copysrc = f->src;
copylen = needlen;
@@ -483,7 +485,7 @@ nomem:
/* Ok, bother. Need to do real work at least with one chunk. */
- dprintf("@: 0x%08x bytes at 0x%08x -> 0x%08x\n",
+ dprintf("@: 0x%08zx bytes at 0x%08zx -> 0x%08zx\n",
f->len, f->src, f->dst);
/* See if we can move this chunk into place by claiming
@@ -509,8 +511,8 @@ nomem:
cbyte = f->dst;
}
- dprintf("need: base = 0x%08x, len = 0x%08x, "
- "reverse = %d, cbyte = 0x%08x\n",
+ dprintf("need: base = 0x%08zx, len = 0x%08zx, "
+ "reverse = %d, cbyte = 0x%08zx\n",
needbase, needlen, reverse, cbyte);
ep = is_free_zone(mmap, cbyte, 1);
@@ -527,7 +529,7 @@ nomem:
if (avail) {
/* We can move at least part of this chunk into place without
further ado */
- dprintf("space: start 0x%08x, len 0x%08x, free 0x%08x\n",
+ dprintf("space: start 0x%08zx, len 0x%08zx, free 0x%08zx\n",
ep->start, ep_len, avail);
copylen = min(needlen, avail);
@@ -545,7 +547,7 @@ nomem:
Then move a chunk of ourselves into place. */
for (op = &f->next, o = *op; o; op = &o->next, o = *op) {
- dprintf("O: 0x%08x bytes at 0x%08x -> 0x%08x\n",
+ dprintf("O: 0x%08zx bytes at 0x%08zx -> 0x%08zx\n",
o->len, o->src, o->dst);
if (!(o->src <= cbyte && o->src + o->len > cbyte))
@@ -588,7 +590,7 @@ nomem:
}
mv = new_movelist(copydst, copysrc, copylen);
- dprintf("C: 0x%08x bytes at 0x%08x -> 0x%08x\n",
+ dprintf("C: 0x%08zx bytes at 0x%08zx -> 0x%08zx\n",
mv->len, mv->src, mv->dst);
*moves = mv;
moves = &mv->next;
diff --git a/com32/lib/syslinux/shuffle.c b/com32/lib/syslinux/shuffle.c
index 4f9c22b7..0f6042f9 100644
--- a/com32/lib/syslinux/shuffle.c
+++ b/com32/lib/syslinux/shuffle.c
@@ -46,7 +46,7 @@
#include <syslinux/boot.h>
struct shuffle_descriptor {
- uint32_t dst, src, len;
+ addr_t dst, src, len;
};
/*
@@ -105,7 +105,7 @@ int syslinux_do_shuffle(struct syslinux_movelist *fraglist,
syslinux_free_memmap(rxmap);
- dprintf("desczone = 0x%08x, descfree = 0x%08x\n", desczone, descfree);
+ dprintf("desczone = 0x%08zx, descfree = 0x%08zx\n", desczone, descfree);
rxmap = syslinux_dup_memmap(memmap);
if (!rxmap)
@@ -165,7 +165,7 @@ int syslinux_do_shuffle(struct syslinux_movelist *fraglist,
{
addr_t descoffs = descaddr - (addr_t) dbuf;
- dprintf("nmoves = %d, nzero = %d, dbuf = %p, offs = 0x%08x\n",
+ dprintf("nmoves = %d, nzero = %d, dbuf = %p, offs = 0x%08zx\n",
nmoves, nzero, dbuf, descoffs);
}
#endif
@@ -177,7 +177,7 @@ int syslinux_do_shuffle(struct syslinux_movelist *fraglist,
dp->dst = mp->dst;
dp->src = mp->src;
dp->len = mp->len;
- dprintf2("[ %08x %08x %08x ]\n", dp->dst, dp->src, dp->len);
+ dprintf2("[ %08zx %08zx %08zx ]\n", dp->dst, dp->src, dp->len);
dp++;
np++;
}
@@ -188,7 +188,7 @@ int syslinux_do_shuffle(struct syslinux_movelist *fraglist,
dp->dst = ml->start;
dp->src = (addr_t) - 1; /* bzero region */
dp->len = ml->next->start - ml->start;
- dprintf2("[ %08x %08x %08x ]\n", dp->dst, dp->src, dp->len);
+ dprintf2("[ %08zx %08zx %08zx ]\n", dp->dst, dp->src, dp->len);
dp++;
np++;
}
diff --git a/com32/lib/syslinux/zonelist.c b/com32/lib/syslinux/zonelist.c
index dbc874c5..b16fba01 100644
--- a/com32/lib/syslinux/zonelist.c
+++ b/com32/lib/syslinux/zonelist.c
@@ -148,7 +148,7 @@ int syslinux_add_memmap(struct syslinux_memmap **list,
}
}
- dprintf("After adding (%#x,%#x,%d):\n", start, len, type);
+ dprintf("After adding (%#zx,%#zx,%d):\n", start, len, type);
syslinux_dump_memmap(*list);
return 0;
diff --git a/com32/lib/vsprintf.c b/com32/lib/vsprintf.c
index 8df62130..270dc1b5 100644
--- a/com32/lib/vsprintf.c
+++ b/com32/lib/vsprintf.c
@@ -4,8 +4,9 @@
#include <stdio.h>
#include <unistd.h>
+#include <limits.h>
int vsprintf(char *buffer, const char *format, va_list ap)
{
- return vsnprintf(buffer, ~(size_t) 0, format, ap);
+ return vsnprintf(buffer, INT_MAX, format, ap);
}
diff --git a/com32/libupload/upload_tftp.c b/com32/libupload/upload_tftp.c
index 1e0b0702..151b96a6 100644
--- a/com32/libupload/upload_tftp.c
+++ b/com32/libupload/upload_tftp.c
@@ -8,7 +8,7 @@
#include <syslinux/config.h>
#include <netinet/in.h>
#include <sys/times.h>
-#include <fs/pxe/pxe.h>
+#include <core_pxe.h>
#include <fs/pxe/url.h>
#include <fs/pxe/tftp.h>
#include "upload_backend.h"
diff --git a/com32/lua/src/cmenu.c b/com32/lua/src/cmenu.c
index 1b128618..2903e0b7 100644
--- a/com32/lua/src/cmenu.c
+++ b/com32/lua/src/cmenu.c
@@ -41,6 +41,7 @@ static int l_add_item (lua_State *L)
static int l_add_sep (lua_State *L)
{
+ (void)L;
add_sep ();
return 0; /* FIXME return menuitem for advanced functions */
}
diff --git a/com32/mboot/map.c b/com32/mboot/map.c
index 97b5b5d7..41024f92 100644
--- a/com32/mboot/map.c
+++ b/com32/mboot/map.c
@@ -61,7 +61,7 @@ addr_t map_data(const void *data, size_t len, size_t align, int flags)
return 0;
}
- dprintf("Mapping 0x%08zx bytes (%#x pad) at 0x%08x\n", len, pad, start);
+ dprintf("Mapping 0x%08zx bytes (%#zx pad) at 0x%08zx\n", len, pad, start);
if (start + len + pad > mboot_high_water_mark)
mboot_high_water_mark = start + len + pad;
@@ -200,12 +200,12 @@ struct multiboot_header *map_image(void *ptr, size_t len)
&& eh->e_entry < ph->p_vaddr + msize)
regs.eip = eh->e_entry + (ph->p_paddr - ph->p_vaddr);
- dprintf("Segment at 0x%08x data 0x%08x len 0x%08x\n",
+ dprintf("Segment at 0x%08zx data 0x%08zx len 0x%08zx\n",
addr, dsize, msize);
if (syslinux_memmap_type(amap, addr, msize) != SMT_FREE) {
printf
- ("Memory segment at 0x%08x (len 0x%08x) is unavailable\n",
+ ("Memory segment at 0x%08zx (len 0x%08zx) is unavailable\n",
addr, msize);
return NULL; /* Memory region unavailable */
}
@@ -306,12 +306,12 @@ struct multiboot_header *map_image(void *ptr, size_t len)
&& eh64->e_entry < ph64->p_vaddr + msize)
regs.eip = eh64->e_entry + (ph64->p_paddr - ph64->p_vaddr);
- dprintf("Segment at 0x%08x data 0x%08x len 0x%08x\n",
+ dprintf("Segment at 0x%08zx data 0x%08zx len 0x%08zx\n",
addr, dsize, msize);
if (syslinux_memmap_type(amap, addr, msize) != SMT_FREE) {
printf
- ("Memory segment at 0x%08x (len 0x%08x) is unavailable\n",
+ ("Memory segment at 0x%08zx (len 0x%08zx) is unavailable\n",
addr, msize);
return NULL; /* Memory region unavailable */
}
@@ -414,7 +414,7 @@ struct multiboot_header *map_image(void *ptr, size_t len)
if (syslinux_memmap_type(amap, mbh->load_addr, data_len + bss_len)
!= SMT_FREE) {
- printf("Memory segment at 0x%08x (len 0x%08x) is unavailable\n",
+ printf("Memory segment at 0x%08x (len 0x%08zx) is unavailable\n",
mbh->load_addr, data_len + bss_len);
return NULL; /* Memory region unavailable */
}
diff --git a/com32/mboot/mem.c b/com32/mboot/mem.c
index d5c559a7..738291e5 100644
--- a/com32/mboot/mem.c
+++ b/com32/mboot/mem.c
@@ -169,7 +169,7 @@ out:
void mboot_make_memmap(void)
{
int i, nmap;
- struct AddrRangeDesc *ard;
+ struct AddrRangeDesc *ard = NULL;
uint32_t lowmem, highmem;
uint32_t highrsvd;
diff --git a/com32/modules/pxechn.c b/com32/modules/pxechn.c
index e4e21e88..0e646a4e 100644
--- a/com32/modules/pxechn.c
+++ b/com32/modules/pxechn.c
@@ -735,9 +735,11 @@ int pxechn_uuid_set(struct pxelinux_opt *pxe)
return -ret; /* dhcp_unpack_packet always returns positive errors */
}
- if (pxe->opts[0][97].len >= 0 )
+ if (pxe->opts[0][97].len >= 0) {
pxechn_setopt(&(pxe->opts[2][97]), pxe->opts[0][97].data, pxe->opts[0][97].len);
return 1;
+ }
+
return 0;
}
diff --git a/com32/samples/hello.c b/com32/samples/hello.c
index d3d4d299..8ab00984 100644
--- a/com32/samples/hello.c
+++ b/com32/samples/hello.c
@@ -18,7 +18,8 @@ int main(int argc __unused, char **argv __unused)
int *nums = NULL;
nums = malloc(NUM_COUNT * sizeof(int));
- printf("Hello, world, from 0x%08X! malloc return %p\n", (unsigned int)&main, nums);
+ printf("Hello, world, from %p! malloc return %p\n",
+ (const void *)&main, nums);
free(nums);
diff --git a/core/Makefile b/core/Makefile
index 50ff35af..fc608e51 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -25,8 +25,10 @@ include $(MAKEDIR)/embedded.mk
-include $(objdir)/version.mk
OPTFLAGS =
-INCLUDES = -I$(SRC)/include -I$(com32)/include -I$(com32)/include/sys -I$(com32)/lib \
- -I$(SRC)/lwip/src/include -I$(SRC)/lwip/src/include/ipv4 -I$(SRC)/fs/pxe
+INCLUDES = -I$(SRC)/include -I$(com32)/include -I$(com32)/include/sys \
+ -I$(com32)/lib \
+ -I$(SRC)/bios/lwip/src/include \
+ -I$(SRC)/bios/lwip/src/include/ipv4 -I$(SRC)/fs/pxe
# This is very similar to cp437; technically it's for Norway and Denmark,
# but it's unlikely the characters that are different will be used in
@@ -34,13 +36,12 @@ INCLUDES = -I$(SRC)/include -I$(com32)/include -I$(com32)/include/sys -I$(com32)
CODEPAGE = cp865
# The targets to build in this directory...
-BTARGET = kwdhash.gen \
- ldlinux.bss ldlinux.sys ldlinux.bin \
+BTARGET = kwdhash.gen ldlinux.bss ldlinux.sys \
isolinux.bin isolinux-debug.bin pxelinux.0 lpxelinux.0
# All primary source files for the main syslinux files
-NASMSRC := $(sort $(wildcard $(SRC)/*.asm))
-NASMHDR := $(sort $(wildcard $(SRC)/*.inc))
+NASMSRC := $(sort $(shell find $(SRC) -name '*.asm' -print))
+NASMHDR := $(sort $(shell find $(SRC) -name '*.inc' -print))
CSRC := $(sort $(shell find $(SRC) -name '*.c' -print))
SSRC := $(sort $(shell find $(SRC) -name '*.S' -print))
CHDR := $(sort $(shell find $(SRC) -name '*.h' -print))
@@ -52,50 +53,35 @@ SOBJ := $(subst $(SRC)/,,$(patsubst %.S,%.o,$(SSRC)))
# To make this compatible with the following $(filter-out), make sure
# we prefix everything with $(SRC)
-CORE_PXE_CSRC = \
- $(addprefix $(SRC)/fs/pxe/, dhcp_option.c pxe.c tftp.c urlparse.c bios.c)
-
-LPXELINUX_CSRC = $(CORE_PXE_CSRC) \
- $(sort $(shell find $(SRC)/lwip -name '*.c' -print)) \
- $(addprefix $(SRC)/fs/pxe/, \
- core.c dnsresolv.c ftp.c ftp_readdir.c gpxeurl.c http.c \
- http_readdir.c idle.c isr.c tcp.c)
-
-PXELINUX_CSRC = $(CORE_PXE_CSRC) \
- $(sort $(shell find $(SRC)/legacynet -name '*.c' -print))
-
-LPXELINUX_OBJS = $(subst $(SRC)/,,$(LPXELINUX_CSRC:%.c=%.o))
-PXELINUX_OBJS = $(subst $(SRC)/,,$(PXELINUX_CSRC:%.c=%.o))
-
-UNITTEST_CSRC = $(shell find $(SRC) -path '*/tests/*.c' -print)
-UNITTEST_OBJS = $(subst $(SRC)/,,$(UNITTEST_CSRC:%.c=%.o))
-
-# Don't include console and network stack specific objects or unit tests
-FILTER_OBJS = %rawcon.o %plaincon.o %pxelinux-c.o %ldlinux-c.o \
- %isolinux-c.o %localboot.o %pxeboot.o \
- $(subst $(OBJ)/,,$(UNITTEST_OBJS)) \
- $(subst $(OBJ)/,,$(LPXELINUX_OBJS)) \
- $(subst $(OBJ)/,,$(PXELINUX_OBJS))
-
+CORE_PXE_DIRS = $(SRC)/bios/pxe
+LPXELINUX_DIRS = $(SRC)/bios/lwip
+PXELINUX_DIRS = $(SRC)/bios/legacynet
+
+CORE_PXE_CSRC = $(sort $(shell find $(CORE_PXE_DIRS) -name '*.c' -print))
+CORE_PXE_SSRC = $(sort $(shell find $(CORE_PXE_DIRS) -name '*.S' -print))
+LPXELINUX_CSRC = $(sort $(shell find $(LPXELINUX_DIRS) -name '*.c' -print))
+LPXELINUX_SSRC = $(sort $(shell find $(LPXELINUX_DIRS) -name '*.S' -print))
+PXELINUX_CSRC = $(sort $(shell find $(PXELINUX_DIRS) -name '*.c' -print))
+PXELINUX_SSRC = $(sort $(shell find $(PXELINUX_DIRS) -name '*.S' -print))
+
+CORE_PXE_OBJS = $(subst $(SRC)/,,$(CORE_PXE_CSRC:%.c=%.o) $(CORE_PXE_SSRC:%.S=%.o))
+LPXELINUX_OBJS = $(subst $(SRC)/,,$(LPXELINUX_CSRC:%.c=%.o) $(LPXELINUX_SSRC:%.S=%.o))
+PXELINUX_OBJS = $(subst $(SRC)/,,$(PXELINUX_CSRC:%.c=%.o) $(PXELINUX_SSRC:%.S=%.o))
+
+UNITTEST_DIRS = $(sort $(shell find $(SRC) -type d -name tests))
+
+# Don't include network stack specific objects or unit tests
+FILTER_DIRS = $(UNITTEST_DIRS) $(CORE_PXE_DIRS) \
+ $(PXELINUX_DIRS) $(LPXELINUX_DIRS)
ifeq ($(FWCLASS),EFI)
-# EFI is single-threaded, and doesn't use the LZO assembly decoder
-FILTER_OBJS += $(subst $(SRC)/,, \
- $(patsubst %.S,%.o, $(sort $(wildcard $(SRC)/lzo/*.S))) \
- $(patsubst %.c,%.o, $(sort $(wildcard $(SRC)/thread/*.c))) \
- $(patsubst %.S,%.o, $(sort $(wildcard $(SRC)/thread/*.S)))) \
- $(patsubst %.asm,%.o, $(sort $(wildcard $(SRC)/*.asm))) \
- $(patsubst %.c,%.o, $(sort $(wildcard $(SRC)/bios*.c)))
+FILTER_DIRS += $(SRC)/bios
endif
+FILTER_OBJS = $(patsubst $(SRC)/%,%/%,$(FILTER_DIRS))
COBJS = $(filter-out $(FILTER_OBJS),$(COBJ))
SOBJS = $(filter-out $(FILTER_OBJS),$(SOBJ))
-ifeq ($(FWCLASS),EFI)
-COBJS += $(subst $(SRC)/,,$(CORE_PXE_CSRC:%.c=%.o) fs/pxe/ftp.o fs/pxe/ftp_readdir.o \
- fs/pxe/http.o fs/pxe/http_readdir.o)
-endif
-
-LIB = libcom32.a
+LIB = bios/libsyslinux.a
LIBS = $(LIB) --whole-archive $(objdir)/com32/lib/libcom32core.a
LIBDEP = $(filter-out -% %start%,$(LIBS))
LIBOBJS = $(COBJS) $(SOBJS)
@@ -145,79 +131,49 @@ ifeq ($(FWCLASS),BIOS)
$(NASM) -f $(NASM_ELF) $(NASMOPT) -DDATE_STR="'$(DATE)'" \
-DHEXDATE="$(HEXDATE)" \
-D$(ARCH) \
- -I$(SRC)/ \
- -l $(@:.o=.lsr) -o $@ -MP -MD $(dir $@).$(notdir $@).d $<
-
-AUXLIBS = libisolinux.a libisolinux-debug.a libldlinux.a \
- libpxelinux.a liblpxelinux.a
+ -I$(SRC)/ -I$(SRC)/bios/ \
+ -l $(@:.o=.lsr) -o $@ -MP -MD $(@D)/.$(@F).d $<
-LDSCRIPT = $(SRC)/$(ARCH)/syslinux.ld
+AUXLIBS = bios/libpxelinux.a bios/liblpxelinux.a
+LDSCRIPT = $(SRC)/bios/syslinux.ld
NASM_ELF = elf
-%.elf: %.o $(LIBDEP) $(LDSCRIPT) $(AUXLIBS)
+%.elf: %.o %-c.o lib%.a $(LIBDEP) $(LDSCRIPT)
$(LD) $(LDFLAGS) -pie -Bsymbolic \
-T $(LDSCRIPT) \
--unresolved-symbols=report-all \
- -E --hash-style=gnu -M -o $@ $< \
- --start-group $(LIBS) $(subst $(*F).elf,lib$(*F).a,$@) --end-group \
- > $(@:.elf=.map)
+ -E --hash-style=gnu -M -o $@ $< $*-c.o \
+ --start-group $(*D)/lib$(*F).a $(LIBS) --end-group \
+ > $*.map
if [ `$(NM) -D -u $@ | wc -l` -ne 0 ]; then \
$(NM) -D -u $@ 1>&2; rm -f $@; false; fi
- $(OBJDUMP) -h $@ > $(@:.elf=.sec)
- $(PERL) $(SRC)/lstadjust.pl $(@:.elf=.lsr) $(@:.elf=.sec) $(@:.elf=.lst)
-
-libisolinux.a: rawcon.o localboot.o isolinux-c.o
- rm -f $@
- $(AR) cq $@ $^
- $(RANLIB) $@
-
-libisolinux-debug.a: libisolinux.a
- cp $^ $@
+ $(OBJDUMP) -h $@ > $*.sec
+ $(PERL) $(SRC)/lstadjust.pl $*.lsr $*.sec $*.lst
# Legacy network stack
-libpxelinux.a: rawcon.o pxeboot.o pxelinux-c.o $(PXELINUX_OBJS)
- rm -f $@
- $(AR) cq $@ $^
- $(RANLIB) $@
+bios/libpxelinux.a: $(CORE_PXE_OBJS) $(PXELINUX_OBJS)
# LwIP network stack
-liblpxelinux.a: rawcon.o pxeboot.o pxelinux-c.o $(LPXELINUX_OBJS)
- rm -f $@
- $(AR) cq $@ $^
- $(RANLIB) $@
+bios/liblpxelinux.a: $(CORE_PXE_OBJS) $(LPXELINUX_OBJS)
-libldlinux.a: plaincon.o localboot.o ldlinux-c.o
+# Otherwise, no special library needed, a null library will be created
+
+bios/lib%.a:
rm -f $@
$(AR) cq $@ $^
$(RANLIB) $@
-pxelinux.o: pxelinux.asm kwdhash.gen ../version.gen
- $(NASM) -f $(NASM_ELF) $(NASMOPT) -DDATE_STR="'$(DATE)'" \
- -DHEXDATE="$(HEXDATE)" \
- -D$(ARCH) \
- -I$(SRC)/ \
- -DIS_LPXELINUX=0 \
- -l $(@:.o=.lsr) -o $@ -MP -MD $(dir $@).$(notdir $@).d $<
-
-pxelinux.0: pxelinux.bin
+%.0: bios/%.bin
cp -f $< $@
-lpxelinux.o: pxelinux.asm kwdhash.gen ../version.gen
- $(NASM) -f $(NASM_ELF) $(NASMOPT) -DDATE_STR="'$(DATE)'" \
- -DHEXDATE="$(HEXDATE)" \
- -D$(ARCH) \
- -I$(SRC)/ \
- -DIS_LPXELINUX=1 \
- -l $(@:.o=.lsr) -o $@ -MP -MD $(dir $@).$(notdir $@).d $<
-
-lpxelinux.0: lpxelinux.bin
+%.bin: bios/%.bin
cp -f $< $@
-ldlinux.bss: ldlinux.bin
+ldlinux.bss: bios/ldlinux.bin
dd if=$< of=$@ bs=512 count=1
-ldlinux.sys: ldlinux.bin
+ldlinux.sys: bios/ldlinux.bin
dd if=$< of=$@ bs=512 skip=2
endif # BIOS
@@ -241,11 +197,13 @@ install-all: install install-lib
netinstall: installer
tidy dist:
- find . -type f \( -name '*.o' -o -name '*.a' -o -name '.*.d' \
- -o -name '*.lst' \) -print | xargs -rt rm -f
- rm -f codepage.cp *.elf stupid.* patch.offset .depend
- rm -f *.elf.tmp *.sym
- rm -f *.lsr *.map *.sec *.raw
+ for d in $(find . -type d -print) ; do \
+ ( cd "$$d" ; \
+ rm -f *.o *.a .*.d *.lst \
+ codepage.cp *.elf stupid.* patch.offset .depend \
+ *.elf.tmp *.sym \
+ *.lsr *.map *.sec *.raw \
+ ); done
rm -f $(OBSOLETE) $(LIB)
clean: tidy
@@ -254,4 +212,4 @@ spotless: clean
rm -f $(BTARGET) *.bin *_bin.c
# Include dependencies file
--include $(shell find . -name '.*.d' -print)
+-include $(shell find $(OBJ) -name '.*.d' -print)
diff --git a/core/adv.inc b/core/bios/adv.inc
index a18020c5..a18020c5 100644
--- a/core/adv.inc
+++ b/core/bios/adv.inc
diff --git a/core/bcopy32.inc b/core/bios/bcopy32.inc
index ab601452..ab601452 100644
--- a/core/bcopy32.inc
+++ b/core/bios/bcopy32.inc
diff --git a/core/bcopyxx.inc b/core/bios/bcopyxx.inc
index 3658f097..3658f097 100644
--- a/core/bcopyxx.inc
+++ b/core/bios/bcopyxx.inc
diff --git a/core/bios.c b/core/bios/bios.c
index 7fb37fec..7fb37fec 100644
--- a/core/bios.c
+++ b/core/bios/bios.c
diff --git a/core/bios.inc b/core/bios/bios.inc
index 2e150594..2e150594 100644
--- a/core/bios.inc
+++ b/core/bios/bios.inc
diff --git a/core/call16.c b/core/bios/call16.c
index 471aef96..471aef96 100644
--- a/core/call16.c
+++ b/core/bios/call16.c
diff --git a/core/callback.inc b/core/bios/callback.inc
index f1332e8e..f1332e8e 100644
--- a/core/callback.inc
+++ b/core/bios/callback.inc
diff --git a/core/com32.inc b/core/bios/com32.inc
index 5561c720..5561c720 100644
--- a/core/com32.inc
+++ b/core/bios/com32.inc
diff --git a/core/common.inc b/core/bios/common.inc
index c42fc56b..c42fc56b 100644
--- a/core/common.inc
+++ b/core/bios/common.inc
diff --git a/core/config.inc b/core/bios/config.inc
index 999d3d91..999d3d91 100644
--- a/core/config.inc
+++ b/core/bios/config.inc
diff --git a/core/bios/conio.c b/core/bios/conio.c
new file mode 100644
index 00000000..ea7a3e5b
--- /dev/null
+++ b/core/bios/conio.c
@@ -0,0 +1,295 @@
+/*
+ * -----------------------------------------------------------------------
+ *
+ * Copyright 1994-2008 H. Peter Anvin - All Rights Reserved
+ * Copyright 2009-2014 Intel Corporation; author: H. Peter Anvin
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+ * Boston MA 02111-1307, USA; either version 2 of the License, or
+ * (at your option) any later version; incorporated herein by reference.
+ *
+ * -----------------------------------------------------------------------
+ *
+ *
+ * conio.c
+ *
+ * Console I/O code, except:
+ * writechr, writestr_early - module-dependent
+ * writestr, crlf - writestr.inc
+ * writehex* - writehex.inc
+ */
+#include <sys/io.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include <fs.h>
+#include <com32.h>
+#include <x86/cpu.h>
+#include <syslinux/firmware.h>
+
+#include "bios.h"
+#include "graphics.h"
+
+union screen _cursor;
+union screen _screensize;
+
+/*
+ * Serial console stuff.
+ */
+__export uint16_t SerialPort = 0; /* Serial port base (or 0 for no serial port) */
+__export uint8_t FlowInput = 0; /* Input bits for serial flow */
+__export uint16_t BaudDivisor = 115200/9600; /* Baud rate divisor */
+__export uint8_t FlowIgnore = 0; /* Ignore input unless these bits set */
+__export uint16_t DisplayCon = 0x01; /* Display console enabled */
+__export uint8_t FlowOutput = 0; /* Output to assert for serial flow */
+
+__export uint8_t DisplayMask = 0x07; /* Display modes mask */
+
+uint8_t ScrollAttribute = 0x07; /* Grey on white (normal text color) */
+
+/*
+ * loadkeys: Load a LILO-style keymap
+ *
+ * Returns 0 on success, or -1 on error.
+ */
+__export int loadkeys(const char *filename)
+{
+ FILE *f;
+
+ f = fopen(filename, "r");
+ if (!f)
+ return -1;
+
+ fread(KbdMap, 1, sizeof(KbdMap), f);
+
+ fclose(f);
+ return 0;
+}
+
+/*
+ * write_serial: If serial output is enabled, write character on
+ * serial port.
+ */
+__export void write_serial(char data)
+{
+ if (!SerialPort)
+ return;
+
+ if (!(DisplayMask & 0x04))
+ return;
+
+ while (1) {
+ char ch;
+
+ ch = inb(SerialPort + 5); /* LSR */
+
+ /* Wait for space in transmit register */
+ if (!(ch & 0x20))
+ continue;
+
+ /* Wait for input flow control */
+ ch = inb(SerialPort + 6);
+ ch &= FlowInput;
+ if (ch != FlowInput)
+ continue;
+
+ break;
+ }
+
+ outb(data, SerialPort); /* Send data */
+ io_delay();
+}
+
+void pm_write_serial(com32sys_t *regs)
+{
+ write_serial(regs->eax.b[0]);
+}
+
+void serialcfg(uint16_t *iobase, uint16_t *divisor, uint16_t *flowctl)
+{
+ uint8_t al, ah;
+
+ *iobase = SerialPort;
+ *divisor = BaudDivisor;
+
+ al = FlowOutput;
+ ah = FlowInput;
+
+ al |= ah;
+ ah = FlowIgnore;
+ ah >>= 4;
+
+ if (!DisplayCon)
+ ah |= 0x80;
+
+ *flowctl = al | (ah << 8);
+}
+
+void pm_serialcfg(com32sys_t *regs)
+{
+ serialcfg(&regs->eax.w[0], &regs->ecx.w[0], &regs->ebx.w[0]);
+}
+
+/*
+ * write_serial_str: write_serial for strings
+ */
+__export void write_serial_str(char *data)
+{
+ char ch;
+
+ while ((ch = *data++))
+ write_serial(ch);
+}
+
+/*
+ * pollchar: check if we have an input character pending
+ *
+ * Returns 1 if character pending.
+ */
+int bios_pollchar(void)
+{
+ com32sys_t ireg, oreg;
+ uint8_t data = 0;
+
+ memset(&ireg, 0, sizeof(ireg));
+
+ ireg.eax.b[1] = 0x11; /* Poll keyboard */
+ __intcall(0x16, &ireg, &oreg);
+
+ if (!(oreg.eflags.l & EFLAGS_ZF))
+ return 1;
+
+ if (SerialPort) {
+ cli();
+
+ /* Already-queued input? */
+ if (SerialTail == SerialHead) {
+ /* LSR */
+ data = inb(SerialPort + 5) & 1;
+ if (data) {
+ /* MSR */
+ data = inb(SerialPort + 6);
+
+ /* Required status bits */
+ data &= FlowIgnore;
+
+ if (data == FlowIgnore)
+ data = 1;
+ else
+ data = 0;
+ }
+ } else
+ data = 1;
+ sti();
+ }
+
+ return data;
+}
+
+void pm_pollchar(com32sys_t *regs)
+{
+ if (pollchar())
+ regs->eflags.l &= ~EFLAGS_ZF;
+ else
+ regs->eflags.l |= EFLAGS_ZF;
+}
+
+char bios_getchar(char *hi)
+{
+ com32sys_t ireg, oreg;
+ unsigned char data;
+
+ memset(&ireg, 0, sizeof(ireg));
+ memset(&oreg, 0, sizeof(oreg));
+ while (1) {
+ __idle();
+
+ ireg.eax.b[1] = 0x11; /* Poll keyboard */
+ __intcall(0x16, &ireg, &oreg);
+
+ if (oreg.eflags.l & EFLAGS_ZF) {
+ if (!SerialPort)
+ continue;
+
+ cli();
+ if (SerialTail != SerialHead) {
+ /* serial queued */
+ sti(); /* We already know we'll consume data */
+ data = *SerialTail++;
+
+ if (SerialTail > SerialHead + serial_buf_size)
+ SerialTail = SerialHead;
+ } else {
+ /* LSR */
+ data = inb(SerialPort + 5) & 1;
+ if (!data) {
+ sti();
+ continue;
+ }
+ data = inb(SerialPort + 6);
+ data &= FlowIgnore;
+ if (data != FlowIgnore) {
+ sti();
+ continue;
+ }
+
+ data = inb(SerialPort);
+ sti();
+ break;
+ }
+ } else {
+ /* Keyboard input? */
+ ireg.eax.b[1] = 0x10; /* Get keyboard input */
+ __intcall(0x16, &ireg, &oreg);
+
+ data = oreg.eax.b[0];
+ *hi = oreg.eax.b[1];
+
+ if (data == 0xE0)
+ data = 0;
+
+ if (data) {
+ /* Convert character sets */
+ data = KbdMap[data];
+ }
+ }
+
+ break;
+ }
+
+ reset_idle(); /* Character received */
+ return data;
+}
+
+uint8_t bios_shiftflags(void)
+{
+ com32sys_t reg;
+ uint8_t ah, al;
+
+ memset(&reg, 0, sizeof reg);
+ reg.eax.b[1] = 0x12;
+ __intcall(0x16, &reg, &reg);
+ ah = reg.eax.b[1];
+ al = reg.eax.b[0];
+
+ /*
+ * According to the Interrupt List, "many machines" don't correctly
+ * fold the Alt state, presumably because it might be AltGr.
+ * Explicitly fold the Alt and Ctrl states; it fits our needs
+ * better.
+ */
+
+ if (ah & 0x0a)
+ al |= 0x08;
+ if (ah & 0x05)
+ al |= 0x04;
+
+ return al;
+}
+
+void pm_getchar(com32sys_t *regs)
+{
+ regs->eax.b[0] = getchar((char *)&regs->eax.b[1]);
+}
diff --git a/core/diskboot.inc b/core/bios/diskboot.inc
index 19d6bcf7..19d6bcf7 100644
--- a/core/diskboot.inc
+++ b/core/bios/diskboot.inc
diff --git a/core/diskfs.inc b/core/bios/diskfs.inc
index 93016649..93016649 100644
--- a/core/diskfs.inc
+++ b/core/bios/diskfs.inc
diff --git a/core/fs/diskio_bios.c b/core/bios/diskio_bios.c
index 7feb7fc4..7feb7fc4 100644
--- a/core/fs/diskio_bios.c
+++ b/core/bios/diskio_bios.c
diff --git a/core/diskstart.inc b/core/bios/diskstart.inc
index 875b4093..875b4093 100644
--- a/core/diskstart.inc
+++ b/core/bios/diskstart.inc
diff --git a/core/extern.inc b/core/bios/extern.inc
index f5460232..e3539611 100644
--- a/core/extern.inc
+++ b/core/bios/extern.inc
@@ -9,16 +9,9 @@
; rllpack.c
extern rllpack, rllunpack
- ; hello.c
- extern hello
-
; elflink/load_env32.c
extern load_env32, pm_env32_run
- extern mp1, mp2, mp3, mp4, mp5
-
- extern hexdump
-
extern mem_init
; fs.c
diff --git a/core/font.c b/core/bios/font.c
index 508f7059..508f7059 100644
--- a/core/font.c
+++ b/core/bios/font.c
diff --git a/core/graphics.c b/core/bios/graphics.c
index 471847f5..471847f5 100644
--- a/core/graphics.c
+++ b/core/bios/graphics.c
diff --git a/core/head.inc b/core/bios/head.inc
index b97db352..b97db352 100644
--- a/core/head.inc
+++ b/core/bios/head.inc
diff --git a/core/init.inc b/core/bios/init.inc
index 8ecbdbd8..8ecbdbd8 100644
--- a/core/init.inc
+++ b/core/bios/init.inc
diff --git a/core/io.inc b/core/bios/io.inc
index 71613463..71613463 100644
--- a/core/io.inc
+++ b/core/bios/io.inc
diff --git a/core/isolinux-c.c b/core/bios/isolinux-c.c
index b0173e08..b0173e08 100644
--- a/core/isolinux-c.c
+++ b/core/bios/isolinux-c.c
diff --git a/core/bios/isolinux-debug-c.c b/core/bios/isolinux-debug-c.c
new file mode 100644
index 00000000..14f05005
--- /dev/null
+++ b/core/bios/isolinux-debug-c.c
@@ -0,0 +1 @@
+#include "isolinux-c.c"
diff --git a/core/isolinux-debug.asm b/core/bios/isolinux-debug.asm
index 9c74b7cd..9c74b7cd 100644
--- a/core/isolinux-debug.asm
+++ b/core/bios/isolinux-debug.asm
diff --git a/core/isolinux.asm b/core/bios/isolinux.asm
index 50d9fe1c..50d9fe1c 100644
--- a/core/isolinux.asm
+++ b/core/bios/isolinux.asm
diff --git a/core/kaboom.c b/core/bios/kaboom.c
index 4c150e76..4c150e76 100644
--- a/core/kaboom.c
+++ b/core/bios/kaboom.c
diff --git a/core/kernel.inc b/core/bios/kernel.inc
index 5e1c7a39..5e1c7a39 100644
--- a/core/kernel.inc
+++ b/core/bios/kernel.inc
diff --git a/core/keywords.inc b/core/bios/keywords.inc
index d91ca4ff..d91ca4ff 100644
--- a/core/keywords.inc
+++ b/core/bios/keywords.inc
diff --git a/core/layout.inc b/core/bios/layout.inc
index bb7cb333..bb7cb333 100644
--- a/core/layout.inc
+++ b/core/bios/layout.inc
diff --git a/core/ldlinux-c.c b/core/bios/ldlinux-c.c
index 1d01d9a7..1d01d9a7 100644
--- a/core/ldlinux-c.c
+++ b/core/bios/ldlinux-c.c
diff --git a/core/ldlinux.asm b/core/bios/ldlinux.asm
index 050f503b..050f503b 100644
--- a/core/ldlinux.asm
+++ b/core/bios/ldlinux.asm
diff --git a/core/legacynet/core.c b/core/bios/legacynet/core.c
index 24a670e0..13d47029 100644
--- a/core/legacynet/core.c
+++ b/core/bios/legacynet/core.c
@@ -2,7 +2,7 @@
#include <com32.h>
#include <core.h>
#include <net.h>
-#include <pxe.h>
+#include "core_pxe.h"
#include <minmax.h>
/* Common receive buffer */
diff --git a/core/legacynet/dnsresolv.c b/core/bios/legacynet/dnsresolv.c
index 9be0a436..809c7120 100644
--- a/core/legacynet/dnsresolv.c
+++ b/core/bios/legacynet/dnsresolv.c
@@ -1,7 +1,7 @@
#include <stdio.h>
#include <string.h>
#include <core.h>
-#include "pxe.h"
+#include "core_pxe.h"
/* DNS CLASS values we care about */
#define CLASS_IN 1
diff --git a/core/legacynet/idle.c b/core/bios/legacynet/idle.c
index 5a94166d..02efc85d 100644
--- a/core/legacynet/idle.c
+++ b/core/bios/legacynet/idle.c
@@ -17,7 +17,7 @@
#include <fs.h>
#include <minmax.h>
#include <x86/cpu.h>
-#include "pxe.h"
+#include "core_pxe.h"
static int pxe_idle_poll(void)
{
diff --git a/core/legacynet/portnum.c b/core/bios/legacynet/portnum.c
index e10af29e..5c066cc1 100644
--- a/core/legacynet/portnum.c
+++ b/core/bios/legacynet/portnum.c
@@ -13,7 +13,7 @@
#include <stdint.h>
#include <stdbool.h>
#include <netinet/in.h>
-#include "pxe.h"
+#include "core_pxe.h"
/* Port number bitmap - port numbers 49152 (0xc000) to 57343 (0xefff) */
#define PORT_NUMBER_BASE 49152
diff --git a/core/localboot.c b/core/bios/localboot.c
index c5fb9eca..d0c289d0 100644
--- a/core/localboot.c
+++ b/core/bios/localboot.c
@@ -22,6 +22,7 @@
* localboot.c
*
* Boot from a local disk, or invoke INT 18h.
+ * This is default, but overridden for pxelinux, hence weak.
*/
#define LOCALBOOT_MSG "Booting from local disk..."
@@ -34,7 +35,7 @@ extern void local_boot16(void);
* Boot a specified local disk. AX specifies the BIOS disk number; or
* -1 in case we should execute INT 18h ("next device.")
*/
-__export void local_boot(int16_t ax)
+__export void __attribute__((weak)) local_boot(int16_t ax)
{
com32sys_t ireg, oreg;
int i;
diff --git a/core/localboot.inc b/core/bios/localboot.inc
index b7840427..b7840427 100644
--- a/core/localboot.inc
+++ b/core/bios/localboot.inc
diff --git a/core/bios/lpxelinux-c.c b/core/bios/lpxelinux-c.c
new file mode 100644
index 00000000..93b4bc9e
--- /dev/null
+++ b/core/bios/lpxelinux-c.c
@@ -0,0 +1 @@
+#include "pxelinux-c.c"
diff --git a/core/bios/lpxelinux.asm b/core/bios/lpxelinux.asm
new file mode 100644
index 00000000..f41961d4
--- /dev/null
+++ b/core/bios/lpxelinux.asm
@@ -0,0 +1,2 @@
+%define IS_LPXELINUX 1
+%include "pxelinux.inc"
diff --git a/core/lwip/CHANGELOG b/core/bios/lwip/CHANGELOG
index 6e27a66b..6e27a66b 100644
--- a/core/lwip/CHANGELOG
+++ b/core/bios/lwip/CHANGELOG
diff --git a/core/lwip/COPYING b/core/bios/lwip/COPYING
index e23898b5..e23898b5 100644
--- a/core/lwip/COPYING
+++ b/core/bios/lwip/COPYING
diff --git a/core/lwip/FILES b/core/bios/lwip/FILES
index 66253196..66253196 100644
--- a/core/lwip/FILES
+++ b/core/bios/lwip/FILES
diff --git a/core/lwip/README b/core/bios/lwip/README
index a62cc4f3..a62cc4f3 100644
--- a/core/lwip/README
+++ b/core/bios/lwip/README
diff --git a/core/lwip/UPGRADING b/core/bios/lwip/UPGRADING
index 6501107a..6501107a 100644
--- a/core/lwip/UPGRADING
+++ b/core/bios/lwip/UPGRADING
diff --git a/core/fs/pxe/core.c b/core/bios/lwip/core.c
index a43ac465..b7a16825 100644
--- a/core/fs/pxe/core.c
+++ b/core/bios/lwip/core.c
@@ -4,7 +4,7 @@
#include <lwip/dns.h>
#include <core.h>
#include <net.h>
-#include "pxe.h"
+#include "core_pxe.h"
#include <dprintf.h>
diff --git a/core/fs/pxe/dnsresolv.c b/core/bios/lwip/dnsresolv.c
index 26c5b34b..0a61392e 100644
--- a/core/fs/pxe/dnsresolv.c
+++ b/core/bios/lwip/dnsresolv.c
@@ -1,7 +1,7 @@
#include <stdio.h>
#include <string.h>
#include <core.h>
-#include "pxe.h"
+#include "core_pxe.h"
#include "lwip/api.h"
#include "lwip/dns.h"
diff --git a/core/lwip/doc/FILES b/core/bios/lwip/doc/FILES
index 05d356f4..05d356f4 100644
--- a/core/lwip/doc/FILES
+++ b/core/bios/lwip/doc/FILES
diff --git a/core/lwip/doc/contrib.txt b/core/bios/lwip/doc/contrib.txt
index 39596fca..39596fca 100644
--- a/core/lwip/doc/contrib.txt
+++ b/core/bios/lwip/doc/contrib.txt
diff --git a/core/lwip/doc/rawapi.txt b/core/bios/lwip/doc/rawapi.txt
index c727da99..c727da99 100644
--- a/core/lwip/doc/rawapi.txt
+++ b/core/bios/lwip/doc/rawapi.txt
diff --git a/core/lwip/doc/savannah.txt b/core/bios/lwip/doc/savannah.txt
index 409905b1..409905b1 100644
--- a/core/lwip/doc/savannah.txt
+++ b/core/bios/lwip/doc/savannah.txt
diff --git a/core/lwip/doc/snmp_agent.txt b/core/bios/lwip/doc/snmp_agent.txt
index 2653230f..2653230f 100644
--- a/core/lwip/doc/snmp_agent.txt
+++ b/core/bios/lwip/doc/snmp_agent.txt
diff --git a/core/lwip/doc/sys_arch.txt b/core/bios/lwip/doc/sys_arch.txt
index 4eb93078..4eb93078 100644
--- a/core/lwip/doc/sys_arch.txt
+++ b/core/bios/lwip/doc/sys_arch.txt
diff --git a/core/fs/pxe/isr.c b/core/bios/lwip/isr.c
index 1fc9c3f2..ef7d95ec 100644
--- a/core/fs/pxe/isr.c
+++ b/core/bios/lwip/isr.c
@@ -7,7 +7,7 @@
#include "core.h"
#include "thread.h"
-#include "pxe.h"
+#include "core_pxe.h"
#include <string.h>
#include <x86/cpu.h>
#include <sys/io.h>
@@ -266,11 +266,18 @@ void pxe_start_isr(void)
dprintf("pxe_start_isr: trying poll by model\n");
int hwad = ((int)MAC[0] << 16) + ((int)MAC[1] << 8) + MAC[2];
dprintf("pxe_start_isr: got %06x %04x\n", hwad, pxe_undi_iface.ServiceFlags);
- if ((hwad == 0x000023ae) && (pxe_undi_iface.ServiceFlags == 0xdc1b) ||
- (hwad == 0x005c260a) && (pxe_undi_iface.ServiceFlags == 0xdc1b) ||
- (hwad == 0x00180373) && (pxe_undi_iface.ServiceFlags == 0xdc1b)) {
+ if (pxe_undi_iface.ServiceFlags == 0xdc1b) {
+ switch (hwad) {
+ case 0x000023ae:
+ case 0x005c260a:
+ case 0x00180373:
asm volatile("orb $1,%0" : "+m" (pxe_need_poll));
dprintf("pxe_start_isr: forcing pxe_need_poll by model\n");
+ break;
+ default:
+ /* Assume we can (or maybe have to) actually use interrupts */
+ break;
+ }
}
}
}
diff --git a/core/lwip/src/FILES b/core/bios/lwip/src/FILES
index 952aeabb..952aeabb 100644
--- a/core/lwip/src/FILES
+++ b/core/bios/lwip/src/FILES
diff --git a/core/lwip/src/api/api_lib.c b/core/bios/lwip/src/api/api_lib.c
index b1a9e525..b1a9e525 100644
--- a/core/lwip/src/api/api_lib.c
+++ b/core/bios/lwip/src/api/api_lib.c
diff --git a/core/lwip/src/api/api_msg.c b/core/bios/lwip/src/api/api_msg.c
index 448f96dd..448f96dd 100644
--- a/core/lwip/src/api/api_msg.c
+++ b/core/bios/lwip/src/api/api_msg.c
diff --git a/core/lwip/src/api/err.c b/core/bios/lwip/src/api/err.c
index 92fa8b7d..92fa8b7d 100644
--- a/core/lwip/src/api/err.c
+++ b/core/bios/lwip/src/api/err.c
diff --git a/core/lwip/src/api/netbuf.c b/core/bios/lwip/src/api/netbuf.c
index 9390c9ee..9390c9ee 100644
--- a/core/lwip/src/api/netbuf.c
+++ b/core/bios/lwip/src/api/netbuf.c
diff --git a/core/lwip/src/api/netdb.c b/core/bios/lwip/src/api/netdb.c
index a7e4e06b..a7e4e06b 100644
--- a/core/lwip/src/api/netdb.c
+++ b/core/bios/lwip/src/api/netdb.c
diff --git a/core/lwip/src/api/netifapi.c b/core/bios/lwip/src/api/netifapi.c
index 43e47203..43e47203 100644
--- a/core/lwip/src/api/netifapi.c
+++ b/core/bios/lwip/src/api/netifapi.c
diff --git a/core/lwip/src/api/sockets.c b/core/bios/lwip/src/api/sockets.c
index e36012ce..e36012ce 100644
--- a/core/lwip/src/api/sockets.c
+++ b/core/bios/lwip/src/api/sockets.c
diff --git a/core/lwip/src/api/tcpip.c b/core/bios/lwip/src/api/tcpip.c
index 857e7d9b..857e7d9b 100644
--- a/core/lwip/src/api/tcpip.c
+++ b/core/bios/lwip/src/api/tcpip.c
diff --git a/core/lwip/src/arch/sys_arch.c b/core/bios/lwip/src/arch/sys_arch.c
index 4081d01e..4081d01e 100644
--- a/core/lwip/src/arch/sys_arch.c
+++ b/core/bios/lwip/src/arch/sys_arch.c
diff --git a/core/lwip/src/core/def.c b/core/bios/lwip/src/core/def.c
index 352b5524..352b5524 100644
--- a/core/lwip/src/core/def.c
+++ b/core/bios/lwip/src/core/def.c
diff --git a/core/lwip/src/core/dhcp.c b/core/bios/lwip/src/core/dhcp.c
index 81b4be27..81b4be27 100644
--- a/core/lwip/src/core/dhcp.c
+++ b/core/bios/lwip/src/core/dhcp.c
diff --git a/core/lwip/src/core/dns.c b/core/bios/lwip/src/core/dns.c
index ca807c14..ca807c14 100644
--- a/core/lwip/src/core/dns.c
+++ b/core/bios/lwip/src/core/dns.c
diff --git a/core/lwip/src/core/init.c b/core/bios/lwip/src/core/init.c
index 36038350..36038350 100644
--- a/core/lwip/src/core/init.c
+++ b/core/bios/lwip/src/core/init.c
diff --git a/core/lwip/src/core/ipv4/autoip.c b/core/bios/lwip/src/core/ipv4/autoip.c
index 92bb4591..92bb4591 100644
--- a/core/lwip/src/core/ipv4/autoip.c
+++ b/core/bios/lwip/src/core/ipv4/autoip.c
diff --git a/core/lwip/src/core/ipv4/icmp.c b/core/bios/lwip/src/core/ipv4/icmp.c
index 32902a52..32902a52 100644
--- a/core/lwip/src/core/ipv4/icmp.c
+++ b/core/bios/lwip/src/core/ipv4/icmp.c
diff --git a/core/lwip/src/core/ipv4/igmp.c b/core/bios/lwip/src/core/ipv4/igmp.c
index 4e4405e1..4e4405e1 100644
--- a/core/lwip/src/core/ipv4/igmp.c
+++ b/core/bios/lwip/src/core/ipv4/igmp.c
diff --git a/core/lwip/src/core/ipv4/inet.c b/core/bios/lwip/src/core/ipv4/inet.c
index e283a576..e283a576 100644
--- a/core/lwip/src/core/ipv4/inet.c
+++ b/core/bios/lwip/src/core/ipv4/inet.c
diff --git a/core/lwip/src/core/ipv4/inet_chksum.c b/core/bios/lwip/src/core/ipv4/inet_chksum.c
index 960252f6..960252f6 100644
--- a/core/lwip/src/core/ipv4/inet_chksum.c
+++ b/core/bios/lwip/src/core/ipv4/inet_chksum.c
diff --git a/core/lwip/src/core/ipv4/ip.c b/core/bios/lwip/src/core/ipv4/ip.c
index 6f248716..6f248716 100644
--- a/core/lwip/src/core/ipv4/ip.c
+++ b/core/bios/lwip/src/core/ipv4/ip.c
diff --git a/core/lwip/src/core/ipv4/ip_addr.c b/core/bios/lwip/src/core/ipv4/ip_addr.c
index 8f633ff2..8f633ff2 100644
--- a/core/lwip/src/core/ipv4/ip_addr.c
+++ b/core/bios/lwip/src/core/ipv4/ip_addr.c
diff --git a/core/lwip/src/core/ipv4/ip_frag.c b/core/bios/lwip/src/core/ipv4/ip_frag.c
index 8d184345..8d184345 100644
--- a/core/lwip/src/core/ipv4/ip_frag.c
+++ b/core/bios/lwip/src/core/ipv4/ip_frag.c
diff --git a/core/lwip/src/core/mem.c b/core/bios/lwip/src/core/mem.c
index 2934e5a9..2934e5a9 100644
--- a/core/lwip/src/core/mem.c
+++ b/core/bios/lwip/src/core/mem.c
diff --git a/core/lwip/src/core/memp.c b/core/bios/lwip/src/core/memp.c
index 4da879a5..4da879a5 100644
--- a/core/lwip/src/core/memp.c
+++ b/core/bios/lwip/src/core/memp.c
diff --git a/core/lwip/src/core/netif.c b/core/bios/lwip/src/core/netif.c
index f190b1f2..f190b1f2 100644
--- a/core/lwip/src/core/netif.c
+++ b/core/bios/lwip/src/core/netif.c
diff --git a/core/lwip/src/core/pbuf.c b/core/bios/lwip/src/core/pbuf.c
index dd9ff64e..dd9ff64e 100644
--- a/core/lwip/src/core/pbuf.c
+++ b/core/bios/lwip/src/core/pbuf.c
diff --git a/core/lwip/src/core/raw.c b/core/bios/lwip/src/core/raw.c
index 9fcb1003..9fcb1003 100644
--- a/core/lwip/src/core/raw.c
+++ b/core/bios/lwip/src/core/raw.c
diff --git a/core/lwip/src/core/snmp/asn1_dec.c b/core/bios/lwip/src/core/snmp/asn1_dec.c
index 1d565820..1d565820 100644
--- a/core/lwip/src/core/snmp/asn1_dec.c
+++ b/core/bios/lwip/src/core/snmp/asn1_dec.c
diff --git a/core/lwip/src/core/snmp/asn1_enc.c b/core/bios/lwip/src/core/snmp/asn1_enc.c
index 64dfc5f6..64dfc5f6 100644
--- a/core/lwip/src/core/snmp/asn1_enc.c
+++ b/core/bios/lwip/src/core/snmp/asn1_enc.c
diff --git a/core/lwip/src/core/snmp/mib2.c b/core/bios/lwip/src/core/snmp/mib2.c
index 29decd30..29decd30 100644
--- a/core/lwip/src/core/snmp/mib2.c
+++ b/core/bios/lwip/src/core/snmp/mib2.c
diff --git a/core/lwip/src/core/snmp/mib_structs.c b/core/bios/lwip/src/core/snmp/mib_structs.c
index 2f185cb4..2f185cb4 100644
--- a/core/lwip/src/core/snmp/mib_structs.c
+++ b/core/bios/lwip/src/core/snmp/mib_structs.c
diff --git a/core/lwip/src/core/snmp/msg_in.c b/core/bios/lwip/src/core/snmp/msg_in.c
index 2dfb55b2..2dfb55b2 100644
--- a/core/lwip/src/core/snmp/msg_in.c
+++ b/core/bios/lwip/src/core/snmp/msg_in.c
diff --git a/core/lwip/src/core/snmp/msg_out.c b/core/bios/lwip/src/core/snmp/msg_out.c
index 4778bee6..4778bee6 100644
--- a/core/lwip/src/core/snmp/msg_out.c
+++ b/core/bios/lwip/src/core/snmp/msg_out.c
diff --git a/core/lwip/src/core/stats.c b/core/bios/lwip/src/core/stats.c
index 69f97d41..69f97d41 100644
--- a/core/lwip/src/core/stats.c
+++ b/core/bios/lwip/src/core/stats.c
diff --git a/core/lwip/src/core/sys.c b/core/bios/lwip/src/core/sys.c
index d3a77deb..d3a77deb 100644
--- a/core/lwip/src/core/sys.c
+++ b/core/bios/lwip/src/core/sys.c
diff --git a/core/lwip/src/core/tcp.c b/core/bios/lwip/src/core/tcp.c
index c629bc4e..c629bc4e 100644
--- a/core/lwip/src/core/tcp.c
+++ b/core/bios/lwip/src/core/tcp.c
diff --git a/core/lwip/src/core/tcp_in.c b/core/bios/lwip/src/core/tcp_in.c
index 90952648..90952648 100644
--- a/core/lwip/src/core/tcp_in.c
+++ b/core/bios/lwip/src/core/tcp_in.c
diff --git a/core/lwip/src/core/tcp_out.c b/core/bios/lwip/src/core/tcp_out.c
index 86e09195..86e09195 100644
--- a/core/lwip/src/core/tcp_out.c
+++ b/core/bios/lwip/src/core/tcp_out.c
diff --git a/core/lwip/src/core/timers.c b/core/bios/lwip/src/core/timers.c
index 4e94f0d1..4e94f0d1 100644
--- a/core/lwip/src/core/timers.c
+++ b/core/bios/lwip/src/core/timers.c
diff --git a/core/lwip/src/core/udp.c b/core/bios/lwip/src/core/udp.c
index 4596ba2b..4596ba2b 100644
--- a/core/lwip/src/core/udp.c
+++ b/core/bios/lwip/src/core/udp.c
diff --git a/core/lwip/src/include/arch/cc.h b/core/bios/lwip/src/include/arch/cc.h
index 5ab13dec..5ab13dec 100644
--- a/core/lwip/src/include/arch/cc.h
+++ b/core/bios/lwip/src/include/arch/cc.h
diff --git a/core/lwip/src/include/arch/perf.h b/core/bios/lwip/src/include/arch/perf.h
index 4ceb850c..4ceb850c 100644
--- a/core/lwip/src/include/arch/perf.h
+++ b/core/bios/lwip/src/include/arch/perf.h
diff --git a/core/lwip/src/include/arch/sys_arch.h b/core/bios/lwip/src/include/arch/sys_arch.h
index 732a19c4..732a19c4 100644
--- a/core/lwip/src/include/arch/sys_arch.h
+++ b/core/bios/lwip/src/include/arch/sys_arch.h
diff --git a/core/lwip/src/include/ipv4/lwip/autoip.h b/core/bios/lwip/src/include/ipv4/lwip/autoip.h
index 23c264a1..23c264a1 100644
--- a/core/lwip/src/include/ipv4/lwip/autoip.h
+++ b/core/bios/lwip/src/include/ipv4/lwip/autoip.h
diff --git a/core/lwip/src/include/ipv4/lwip/icmp.h b/core/bios/lwip/src/include/ipv4/lwip/icmp.h
index d47a7d8a..d47a7d8a 100644
--- a/core/lwip/src/include/ipv4/lwip/icmp.h
+++ b/core/bios/lwip/src/include/ipv4/lwip/icmp.h
diff --git a/core/lwip/src/include/ipv4/lwip/igmp.h b/core/bios/lwip/src/include/ipv4/lwip/igmp.h
index 8aabac24..8aabac24 100644
--- a/core/lwip/src/include/ipv4/lwip/igmp.h
+++ b/core/bios/lwip/src/include/ipv4/lwip/igmp.h
diff --git a/core/lwip/src/include/ipv4/lwip/inet.h b/core/bios/lwip/src/include/ipv4/lwip/inet.h
index 0513c740..0513c740 100644
--- a/core/lwip/src/include/ipv4/lwip/inet.h
+++ b/core/bios/lwip/src/include/ipv4/lwip/inet.h
diff --git a/core/lwip/src/include/ipv4/lwip/inet_chksum.h b/core/bios/lwip/src/include/ipv4/lwip/inet_chksum.h
index 79a2d90f..79a2d90f 100644
--- a/core/lwip/src/include/ipv4/lwip/inet_chksum.h
+++ b/core/bios/lwip/src/include/ipv4/lwip/inet_chksum.h
diff --git a/core/lwip/src/include/ipv4/lwip/ip.h b/core/bios/lwip/src/include/ipv4/lwip/ip.h
index 74f501d1..74f501d1 100644
--- a/core/lwip/src/include/ipv4/lwip/ip.h
+++ b/core/bios/lwip/src/include/ipv4/lwip/ip.h
diff --git a/core/lwip/src/include/ipv4/lwip/ip_addr.h b/core/bios/lwip/src/include/ipv4/lwip/ip_addr.h
index 77f84e02..77f84e02 100644
--- a/core/lwip/src/include/ipv4/lwip/ip_addr.h
+++ b/core/bios/lwip/src/include/ipv4/lwip/ip_addr.h
diff --git a/core/lwip/src/include/ipv4/lwip/ip_frag.h b/core/bios/lwip/src/include/ipv4/lwip/ip_frag.h
index 77b5eb1e..77b5eb1e 100644
--- a/core/lwip/src/include/ipv4/lwip/ip_frag.h
+++ b/core/bios/lwip/src/include/ipv4/lwip/ip_frag.h
diff --git a/core/lwip/src/include/lwip/api.h b/core/bios/lwip/src/include/lwip/api.h
index 91b9e5d2..91b9e5d2 100644
--- a/core/lwip/src/include/lwip/api.h
+++ b/core/bios/lwip/src/include/lwip/api.h
diff --git a/core/lwip/src/include/lwip/api_msg.h b/core/bios/lwip/src/include/lwip/api_msg.h
index f99d8c3b..f99d8c3b 100644
--- a/core/lwip/src/include/lwip/api_msg.h
+++ b/core/bios/lwip/src/include/lwip/api_msg.h
diff --git a/core/lwip/src/include/lwip/arch.h b/core/bios/lwip/src/include/lwip/arch.h
index 524af6be..524af6be 100644
--- a/core/lwip/src/include/lwip/arch.h
+++ b/core/bios/lwip/src/include/lwip/arch.h
diff --git a/core/lwip/src/include/lwip/debug.h b/core/bios/lwip/src/include/lwip/debug.h
index d8359ea3..d8359ea3 100644
--- a/core/lwip/src/include/lwip/debug.h
+++ b/core/bios/lwip/src/include/lwip/debug.h
diff --git a/core/lwip/src/include/lwip/def.h b/core/bios/lwip/src/include/lwip/def.h
index 9b6de6a8..9b6de6a8 100644
--- a/core/lwip/src/include/lwip/def.h
+++ b/core/bios/lwip/src/include/lwip/def.h
diff --git a/core/lwip/src/include/lwip/dhcp.h b/core/bios/lwip/src/include/lwip/dhcp.h
index 32d93381..32d93381 100644
--- a/core/lwip/src/include/lwip/dhcp.h
+++ b/core/bios/lwip/src/include/lwip/dhcp.h
diff --git a/core/lwip/src/include/lwip/dns.h b/core/bios/lwip/src/include/lwip/dns.h
index 6c7d9b07..6c7d9b07 100644
--- a/core/lwip/src/include/lwip/dns.h
+++ b/core/bios/lwip/src/include/lwip/dns.h
diff --git a/core/lwip/src/include/lwip/err.h b/core/bios/lwip/src/include/lwip/err.h
index ac907729..ac907729 100644
--- a/core/lwip/src/include/lwip/err.h
+++ b/core/bios/lwip/src/include/lwip/err.h
diff --git a/core/lwip/src/include/lwip/init.h b/core/bios/lwip/src/include/lwip/init.h
index 77dcdfc7..77dcdfc7 100644
--- a/core/lwip/src/include/lwip/init.h
+++ b/core/bios/lwip/src/include/lwip/init.h
diff --git a/core/lwip/src/include/lwip/mem.h b/core/bios/lwip/src/include/lwip/mem.h
index 4dbf2f64..4dbf2f64 100644
--- a/core/lwip/src/include/lwip/mem.h
+++ b/core/bios/lwip/src/include/lwip/mem.h
diff --git a/core/lwip/src/include/lwip/memp.h b/core/bios/lwip/src/include/lwip/memp.h
index f0d07399..f0d07399 100644
--- a/core/lwip/src/include/lwip/memp.h
+++ b/core/bios/lwip/src/include/lwip/memp.h
diff --git a/core/lwip/src/include/lwip/memp_std.h b/core/bios/lwip/src/include/lwip/memp_std.h
index 6ce408fb..6ce408fb 100644
--- a/core/lwip/src/include/lwip/memp_std.h
+++ b/core/bios/lwip/src/include/lwip/memp_std.h
diff --git a/core/lwip/src/include/lwip/netbuf.h b/core/bios/lwip/src/include/lwip/netbuf.h
index 7d247d71..7d247d71 100644
--- a/core/lwip/src/include/lwip/netbuf.h
+++ b/core/bios/lwip/src/include/lwip/netbuf.h
diff --git a/core/lwip/src/include/lwip/netdb.h b/core/bios/lwip/src/include/lwip/netdb.h
index 7587e2f2..7587e2f2 100644
--- a/core/lwip/src/include/lwip/netdb.h
+++ b/core/bios/lwip/src/include/lwip/netdb.h
diff --git a/core/lwip/src/include/lwip/netif.h b/core/bios/lwip/src/include/lwip/netif.h
index 8e799295..8e799295 100644
--- a/core/lwip/src/include/lwip/netif.h
+++ b/core/bios/lwip/src/include/lwip/netif.h
diff --git a/core/lwip/src/include/lwip/netifapi.h b/core/bios/lwip/src/include/lwip/netifapi.h
index 33318efa..33318efa 100644
--- a/core/lwip/src/include/lwip/netifapi.h
+++ b/core/bios/lwip/src/include/lwip/netifapi.h
diff --git a/core/lwip/src/include/lwip/opt.h b/core/bios/lwip/src/include/lwip/opt.h
index 490aab43..490aab43 100644
--- a/core/lwip/src/include/lwip/opt.h
+++ b/core/bios/lwip/src/include/lwip/opt.h
diff --git a/core/lwip/src/include/lwip/pbuf.h b/core/bios/lwip/src/include/lwip/pbuf.h
index 3b1d608b..3b1d608b 100644
--- a/core/lwip/src/include/lwip/pbuf.h
+++ b/core/bios/lwip/src/include/lwip/pbuf.h
diff --git a/core/lwip/src/include/lwip/raw.h b/core/bios/lwip/src/include/lwip/raw.h
index 17d0a1c5..17d0a1c5 100644
--- a/core/lwip/src/include/lwip/raw.h
+++ b/core/bios/lwip/src/include/lwip/raw.h
diff --git a/core/lwip/src/include/lwip/sio.h b/core/bios/lwip/src/include/lwip/sio.h
index 28ae2f22..28ae2f22 100644
--- a/core/lwip/src/include/lwip/sio.h
+++ b/core/bios/lwip/src/include/lwip/sio.h
diff --git a/core/lwip/src/include/lwip/snmp.h b/core/bios/lwip/src/include/lwip/snmp.h
index 2ed043dd..2ed043dd 100644
--- a/core/lwip/src/include/lwip/snmp.h
+++ b/core/bios/lwip/src/include/lwip/snmp.h
diff --git a/core/lwip/src/include/lwip/snmp_asn1.h b/core/bios/lwip/src/include/lwip/snmp_asn1.h
index 605fa3f1..605fa3f1 100644
--- a/core/lwip/src/include/lwip/snmp_asn1.h
+++ b/core/bios/lwip/src/include/lwip/snmp_asn1.h
diff --git a/core/lwip/src/include/lwip/snmp_msg.h b/core/bios/lwip/src/include/lwip/snmp_msg.h
index 1183e3a9..1183e3a9 100644
--- a/core/lwip/src/include/lwip/snmp_msg.h
+++ b/core/bios/lwip/src/include/lwip/snmp_msg.h
diff --git a/core/lwip/src/include/lwip/snmp_structs.h b/core/bios/lwip/src/include/lwip/snmp_structs.h
index 0d3b46a9..0d3b46a9 100644
--- a/core/lwip/src/include/lwip/snmp_structs.h
+++ b/core/bios/lwip/src/include/lwip/snmp_structs.h
diff --git a/core/lwip/src/include/lwip/sockets.h b/core/bios/lwip/src/include/lwip/sockets.h
index 3c8fed24..3c8fed24 100644
--- a/core/lwip/src/include/lwip/sockets.h
+++ b/core/bios/lwip/src/include/lwip/sockets.h
diff --git a/core/lwip/src/include/lwip/stats.h b/core/bios/lwip/src/include/lwip/stats.h
index 015b7ce7..015b7ce7 100644
--- a/core/lwip/src/include/lwip/stats.h
+++ b/core/bios/lwip/src/include/lwip/stats.h
diff --git a/core/lwip/src/include/lwip/sys.h b/core/bios/lwip/src/include/lwip/sys.h
index 9f62c754..9f62c754 100644
--- a/core/lwip/src/include/lwip/sys.h
+++ b/core/bios/lwip/src/include/lwip/sys.h
diff --git a/core/lwip/src/include/lwip/tcp.h b/core/bios/lwip/src/include/lwip/tcp.h
index 07dcd10e..07dcd10e 100644
--- a/core/lwip/src/include/lwip/tcp.h
+++ b/core/bios/lwip/src/include/lwip/tcp.h
diff --git a/core/lwip/src/include/lwip/tcp_impl.h b/core/bios/lwip/src/include/lwip/tcp_impl.h
index b4feec0d..b4feec0d 100644
--- a/core/lwip/src/include/lwip/tcp_impl.h
+++ b/core/bios/lwip/src/include/lwip/tcp_impl.h
diff --git a/core/lwip/src/include/lwip/tcpip.h b/core/bios/lwip/src/include/lwip/tcpip.h
index 995ba8ad..995ba8ad 100644
--- a/core/lwip/src/include/lwip/tcpip.h
+++ b/core/bios/lwip/src/include/lwip/tcpip.h
diff --git a/core/lwip/src/include/lwip/timers.h b/core/bios/lwip/src/include/lwip/timers.h
index fb92b4b4..fb92b4b4 100644
--- a/core/lwip/src/include/lwip/timers.h
+++ b/core/bios/lwip/src/include/lwip/timers.h
diff --git a/core/lwip/src/include/lwip/udp.h b/core/bios/lwip/src/include/lwip/udp.h
index c98c1b3e..c98c1b3e 100644
--- a/core/lwip/src/include/lwip/udp.h
+++ b/core/bios/lwip/src/include/lwip/udp.h
diff --git a/core/lwip/src/include/lwipopts.h b/core/bios/lwip/src/include/lwipopts.h
index e0d39b89..e0d39b89 100644
--- a/core/lwip/src/include/lwipopts.h
+++ b/core/bios/lwip/src/include/lwipopts.h
diff --git a/core/lwip/src/include/netif/etharp.h b/core/bios/lwip/src/include/netif/etharp.h
index 691575fa..691575fa 100644
--- a/core/lwip/src/include/netif/etharp.h
+++ b/core/bios/lwip/src/include/netif/etharp.h
diff --git a/core/lwip/src/include/netif/ppp_oe.h b/core/bios/lwip/src/include/netif/ppp_oe.h
index e1cdfa51..e1cdfa51 100644
--- a/core/lwip/src/include/netif/ppp_oe.h
+++ b/core/bios/lwip/src/include/netif/ppp_oe.h
diff --git a/core/lwip/src/include/netif/slipif.h b/core/bios/lwip/src/include/netif/slipif.h
index ccd03c8a..ccd03c8a 100644
--- a/core/lwip/src/include/netif/slipif.h
+++ b/core/bios/lwip/src/include/netif/slipif.h
diff --git a/core/lwip/src/netif/FILES b/core/bios/lwip/src/netif/FILES
index 099dbf3e..099dbf3e 100644
--- a/core/lwip/src/netif/FILES
+++ b/core/bios/lwip/src/netif/FILES
diff --git a/core/lwip/src/netif/etharp.c b/core/bios/lwip/src/netif/etharp.c
index b60dadd0..b60dadd0 100644
--- a/core/lwip/src/netif/etharp.c
+++ b/core/bios/lwip/src/netif/etharp.c
diff --git a/core/lwip/src/netif/ethernetif.c b/core/bios/lwip/src/netif/ethernetif.c
index a5b7d990..a5b7d990 100644
--- a/core/lwip/src/netif/ethernetif.c
+++ b/core/bios/lwip/src/netif/ethernetif.c
diff --git a/core/lwip/src/netif/ppp/auth.c b/core/bios/lwip/src/netif/ppp/auth.c
index c3c49d22..c3c49d22 100644
--- a/core/lwip/src/netif/ppp/auth.c
+++ b/core/bios/lwip/src/netif/ppp/auth.c
diff --git a/core/lwip/src/netif/ppp/auth.h b/core/bios/lwip/src/netif/ppp/auth.h
index a8069ec4..a8069ec4 100644
--- a/core/lwip/src/netif/ppp/auth.h
+++ b/core/bios/lwip/src/netif/ppp/auth.h
diff --git a/core/lwip/src/netif/ppp/chap.c b/core/bios/lwip/src/netif/ppp/chap.c
index 3a49ff8a..3a49ff8a 100644
--- a/core/lwip/src/netif/ppp/chap.c
+++ b/core/bios/lwip/src/netif/ppp/chap.c
diff --git a/core/lwip/src/netif/ppp/chap.h b/core/bios/lwip/src/netif/ppp/chap.h
index fedcab8d..fedcab8d 100644
--- a/core/lwip/src/netif/ppp/chap.h
+++ b/core/bios/lwip/src/netif/ppp/chap.h
diff --git a/core/lwip/src/netif/ppp/chpms.c b/core/bios/lwip/src/netif/ppp/chpms.c
index 83acefce..83acefce 100644
--- a/core/lwip/src/netif/ppp/chpms.c
+++ b/core/bios/lwip/src/netif/ppp/chpms.c
diff --git a/core/lwip/src/netif/ppp/chpms.h b/core/bios/lwip/src/netif/ppp/chpms.h
index df070fb3..df070fb3 100644
--- a/core/lwip/src/netif/ppp/chpms.h
+++ b/core/bios/lwip/src/netif/ppp/chpms.h
diff --git a/core/lwip/src/netif/ppp/fsm.c b/core/bios/lwip/src/netif/ppp/fsm.c
index 2e73c5af..2e73c5af 100644
--- a/core/lwip/src/netif/ppp/fsm.c
+++ b/core/bios/lwip/src/netif/ppp/fsm.c
diff --git a/core/lwip/src/netif/ppp/fsm.h b/core/bios/lwip/src/netif/ppp/fsm.h
index 8d41b5f5..8d41b5f5 100644
--- a/core/lwip/src/netif/ppp/fsm.h
+++ b/core/bios/lwip/src/netif/ppp/fsm.h
diff --git a/core/lwip/src/netif/ppp/ipcp.c b/core/bios/lwip/src/netif/ppp/ipcp.c
index 461a600f..461a600f 100644
--- a/core/lwip/src/netif/ppp/ipcp.c
+++ b/core/bios/lwip/src/netif/ppp/ipcp.c
diff --git a/core/lwip/src/netif/ppp/ipcp.h b/core/bios/lwip/src/netif/ppp/ipcp.h
index de03f460..de03f460 100644
--- a/core/lwip/src/netif/ppp/ipcp.h
+++ b/core/bios/lwip/src/netif/ppp/ipcp.h
diff --git a/core/lwip/src/netif/ppp/lcp.c b/core/bios/lwip/src/netif/ppp/lcp.c
index 21c83ac4..21c83ac4 100644
--- a/core/lwip/src/netif/ppp/lcp.c
+++ b/core/bios/lwip/src/netif/ppp/lcp.c
diff --git a/core/lwip/src/netif/ppp/lcp.h b/core/bios/lwip/src/netif/ppp/lcp.h
index b9201eeb..b9201eeb 100644
--- a/core/lwip/src/netif/ppp/lcp.h
+++ b/core/bios/lwip/src/netif/ppp/lcp.h
diff --git a/core/lwip/src/netif/ppp/magic.c b/core/bios/lwip/src/netif/ppp/magic.c
index 39013308..39013308 100644
--- a/core/lwip/src/netif/ppp/magic.c
+++ b/core/bios/lwip/src/netif/ppp/magic.c
diff --git a/core/lwip/src/netif/ppp/magic.h b/core/bios/lwip/src/netif/ppp/magic.h
index eba70d20..eba70d20 100644
--- a/core/lwip/src/netif/ppp/magic.h
+++ b/core/bios/lwip/src/netif/ppp/magic.h
diff --git a/core/lwip/src/netif/ppp/md5.c b/core/bios/lwip/src/netif/ppp/md5.c
index 3cb69e2b..3cb69e2b 100644
--- a/core/lwip/src/netif/ppp/md5.c
+++ b/core/bios/lwip/src/netif/ppp/md5.c
diff --git a/core/lwip/src/netif/ppp/md5.h b/core/bios/lwip/src/netif/ppp/md5.h
index e129533f..e129533f 100644
--- a/core/lwip/src/netif/ppp/md5.h
+++ b/core/bios/lwip/src/netif/ppp/md5.h
diff --git a/core/lwip/src/netif/ppp/pap.c b/core/bios/lwip/src/netif/ppp/pap.c
index ac44e646..ac44e646 100644
--- a/core/lwip/src/netif/ppp/pap.c
+++ b/core/bios/lwip/src/netif/ppp/pap.c
diff --git a/core/lwip/src/netif/ppp/pap.h b/core/bios/lwip/src/netif/ppp/pap.h
index c99a2040..c99a2040 100644
--- a/core/lwip/src/netif/ppp/pap.h
+++ b/core/bios/lwip/src/netif/ppp/pap.h
diff --git a/core/lwip/src/netif/ppp/ppp.c b/core/bios/lwip/src/netif/ppp/ppp.c
index e9b433b0..e9b433b0 100644
--- a/core/lwip/src/netif/ppp/ppp.c
+++ b/core/bios/lwip/src/netif/ppp/ppp.c
diff --git a/core/lwip/src/netif/ppp/ppp.h b/core/bios/lwip/src/netif/ppp/ppp.h
index a72ac957..a72ac957 100644
--- a/core/lwip/src/netif/ppp/ppp.h
+++ b/core/bios/lwip/src/netif/ppp/ppp.h
diff --git a/core/lwip/src/netif/ppp/ppp_oe.c b/core/bios/lwip/src/netif/ppp/ppp_oe.c
index 040a0bc9..040a0bc9 100644
--- a/core/lwip/src/netif/ppp/ppp_oe.c
+++ b/core/bios/lwip/src/netif/ppp/ppp_oe.c
diff --git a/core/lwip/src/netif/ppp/pppdebug.h b/core/bios/lwip/src/netif/ppp/pppdebug.h
index 81349971..81349971 100644
--- a/core/lwip/src/netif/ppp/pppdebug.h
+++ b/core/bios/lwip/src/netif/ppp/pppdebug.h
diff --git a/core/lwip/src/netif/ppp/randm.c b/core/bios/lwip/src/netif/ppp/randm.c
index 2f35caf6..2f35caf6 100644
--- a/core/lwip/src/netif/ppp/randm.c
+++ b/core/bios/lwip/src/netif/ppp/randm.c
diff --git a/core/lwip/src/netif/ppp/randm.h b/core/bios/lwip/src/netif/ppp/randm.h
index a0984b02..a0984b02 100644
--- a/core/lwip/src/netif/ppp/randm.h
+++ b/core/bios/lwip/src/netif/ppp/randm.h
diff --git a/core/lwip/src/netif/ppp/vj.c b/core/bios/lwip/src/netif/ppp/vj.c
index b7f2d54c..b7f2d54c 100644
--- a/core/lwip/src/netif/ppp/vj.c
+++ b/core/bios/lwip/src/netif/ppp/vj.c
diff --git a/core/lwip/src/netif/ppp/vj.h b/core/bios/lwip/src/netif/ppp/vj.h
index fad12136..fad12136 100644
--- a/core/lwip/src/netif/ppp/vj.h
+++ b/core/bios/lwip/src/netif/ppp/vj.h
diff --git a/core/lwip/src/netif/slipif.c b/core/bios/lwip/src/netif/slipif.c
index c19333dd..c19333dd 100644
--- a/core/lwip/src/netif/slipif.c
+++ b/core/bios/lwip/src/netif/slipif.c
diff --git a/core/lwip/src/netif/undiif.c b/core/bios/lwip/src/netif/undiif.c
index d68edef1..42706658 100644
--- a/core/lwip/src/netif/undiif.c
+++ b/core/bios/lwip/src/netif/undiif.c
@@ -76,7 +76,7 @@
#include "netif/ppp_oe.h"
#include "lwip/netifapi.h"
#include "lwip/tcpip.h"
-#include "../../../fs/pxe/pxe.h"
+#include "core_pxe.h"
#include <inttypes.h>
#include <string.h>
diff --git a/core/fs/pxe/tcp.c b/core/bios/lwip/tcp.c
index 0fb6efd0..d32b5207 100644
--- a/core/fs/pxe/tcp.c
+++ b/core/bios/lwip/tcp.c
@@ -16,7 +16,7 @@
* Common operations for TCP-based network protocols
*/
-#include "pxe.h"
+#include "core_pxe.h"
#include "net.h"
const struct pxe_conn_ops tcp_conn_ops = {
diff --git a/core/thread/exit_thread.c b/core/bios/lwip/thread/exit_thread.c
index d9fd83ad..d9fd83ad 100644
--- a/core/thread/exit_thread.c
+++ b/core/bios/lwip/thread/exit_thread.c
diff --git a/core/thread/idle_thread.c b/core/bios/lwip/thread/idle_thread.c
index f709531b..f709531b 100644
--- a/core/thread/idle_thread.c
+++ b/core/bios/lwip/thread/idle_thread.c
diff --git a/core/thread/kill_thread.c b/core/bios/lwip/thread/kill_thread.c
index c22517c6..c22517c6 100644
--- a/core/thread/kill_thread.c
+++ b/core/bios/lwip/thread/kill_thread.c
diff --git a/core/thread/mbox.c b/core/bios/lwip/thread/mbox.c
index d1c640a9..d1c640a9 100644
--- a/core/thread/mbox.c
+++ b/core/bios/lwip/thread/mbox.c
diff --git a/core/thread/root_thread.c b/core/bios/lwip/thread/root_thread.c
index 2bba7c26..2bba7c26 100644
--- a/core/thread/root_thread.c
+++ b/core/bios/lwip/thread/root_thread.c
diff --git a/core/thread/schedule.c b/core/bios/lwip/thread/schedule.c
index 4f0dfe37..9dbc5843 100644
--- a/core/thread/schedule.c
+++ b/core/bios/lwip/thread/schedule.c
@@ -2,11 +2,11 @@
#include <x86/cpu.h>
#include "thread.h"
#include "core.h"
-#include <dprintf.h>
-#ifndef DEBUG_THREAD
-#define dprintf
+#ifndef DEBUG_THREAD /* Thread debugging is extra tricky */
+# undef DEBUG_CORE
#endif
+#include <dprintf.h>
void (*sched_hook_func)(void);
diff --git a/core/thread/sem_asm.S b/core/bios/lwip/thread/sem_asm.S
index ce67471a..ce67471a 100644
--- a/core/thread/sem_asm.S
+++ b/core/bios/lwip/thread/sem_asm.S
diff --git a/core/thread/semaphore.c b/core/bios/lwip/thread/semaphore.c
index b85bc1e3..b85bc1e3 100644
--- a/core/thread/semaphore.c
+++ b/core/bios/lwip/thread/semaphore.c
diff --git a/core/thread/start_thread.c b/core/bios/lwip/thread/start_thread.c
index 2e4320a4..2e4320a4 100644
--- a/core/thread/start_thread.c
+++ b/core/bios/lwip/thread/start_thread.c
diff --git a/core/thread/thread_asm.S b/core/bios/lwip/thread/thread_asm.S
index ec3e0add..ec3e0add 100644
--- a/core/thread/thread_asm.S
+++ b/core/bios/lwip/thread/thread_asm.S
diff --git a/core/thread/timeout.c b/core/bios/lwip/thread/timeout.c
index 409ad6d7..409ad6d7 100644
--- a/core/thread/timeout.c
+++ b/core/bios/lwip/thread/timeout.c
diff --git a/core/lzo/enter.ash b/core/bios/lzo/enter.ash
index c121c573..c121c573 100644
--- a/core/lzo/enter.ash
+++ b/core/bios/lzo/enter.ash
diff --git a/core/lzo/leave.ash b/core/bios/lzo/leave.ash
index 2aa02867..2aa02867 100644
--- a/core/lzo/leave.ash
+++ b/core/bios/lzo/leave.ash
diff --git a/core/lzo/lzo1c_d.ash b/core/bios/lzo/lzo1c_d.ash
index 4560452b..4560452b 100644
--- a/core/lzo/lzo1c_d.ash
+++ b/core/bios/lzo/lzo1c_d.ash
diff --git a/core/lzo/lzo1f_d.ash b/core/bios/lzo/lzo1f_d.ash
index 50248d8b..50248d8b 100644
--- a/core/lzo/lzo1f_d.ash
+++ b/core/bios/lzo/lzo1f_d.ash
diff --git a/core/lzo/lzo1x_d.ash b/core/bios/lzo/lzo1x_d.ash
index a05f15dc..a05f15dc 100644
--- a/core/lzo/lzo1x_d.ash
+++ b/core/bios/lzo/lzo1x_d.ash
diff --git a/core/lzo/lzo1x_f2.S b/core/bios/lzo/lzo1x_f2.S
index 8cc26b8b..8cc26b8b 100644
--- a/core/lzo/lzo1x_f2.S
+++ b/core/bios/lzo/lzo1x_f2.S
diff --git a/core/lzo/lzo_asm.h b/core/bios/lzo/lzo_asm.h
index 1958517d..1958517d 100644
--- a/core/lzo/lzo_asm.h
+++ b/core/bios/lzo/lzo_asm.h
diff --git a/core/macros.inc b/core/bios/macros.inc
index c8fbe8de..c8fbe8de 100644
--- a/core/macros.inc
+++ b/core/bios/macros.inc
diff --git a/core/bios/null_thread.c b/core/bios/null_thread.c
new file mode 100644
index 00000000..51e0441c
--- /dev/null
+++ b/core/bios/null_thread.c
@@ -0,0 +1,18 @@
+/*
+ * Null implementation of threading
+ */
+
+#include "thread.h"
+
+mstime_t __attribute__((weak)) sem_down(struct semaphore *sem, mstime_t ms)
+{
+ (void)sem;
+ (void)ms;
+ return 0;
+}
+
+void __attribute__((weak)) sem_up(struct semaphore *sem)
+{
+ (void)sem;
+}
+
diff --git a/core/plaincon.c b/core/bios/plaincon.c
index 66c259eb..66c259eb 100644
--- a/core/plaincon.c
+++ b/core/bios/plaincon.c
diff --git a/core/pm.inc b/core/bios/pm.inc
index 7b98944f..7b98944f 100644
--- a/core/pm.inc
+++ b/core/bios/pm.inc
diff --git a/core/pmcall.inc b/core/bios/pmcall.inc
index 0a580150..0a580150 100644
--- a/core/pmcall.inc
+++ b/core/bios/pmcall.inc
diff --git a/core/prefix.inc b/core/bios/prefix.inc
index 9c8724b5..9c8724b5 100644
--- a/core/prefix.inc
+++ b/core/bios/prefix.inc
diff --git a/core/pxe.inc b/core/bios/pxe.inc
index 9b46bb67..9b46bb67 100644
--- a/core/pxe.inc
+++ b/core/bios/pxe.inc
diff --git a/core/fs/pxe/bios.c b/core/bios/pxe/bios.c
index ddf9982b..2db7a544 100644
--- a/core/fs/pxe/bios.c
+++ b/core/bios/pxe/bios.c
@@ -1,11 +1,12 @@
#include <syslinux/firmware.h>
#include <syslinux/memscan.h>
#include <core.h>
-#include "pxe.h"
+#include "core_pxe.h"
#include <net.h>
#include <minmax.h>
#include <bios.h>
#include <dprintf.h>
+#include "thread.h"
static uint16_t real_base_mem; /* Amount of DOS memory after freeing */
@@ -458,3 +459,30 @@ void net_parse_dhcp(void)
lfree(bp);
}
+
+/*
+ * the ASM pxenv function wrapper, return 1 if error, or 0
+ *
+ */
+__export int pxe_call(int opcode, void *data)
+{
+ static DECLARE_INIT_SEMAPHORE(pxe_sem, 1);
+ extern void pxenv(void);
+ com32sys_t regs;
+
+ sem_down(&pxe_sem, 0);
+
+#if 0
+ dprintf("pxe_call op %04x data %p\n", opcode, data);
+#endif
+
+ memset(&regs, 0, sizeof regs);
+ regs.ebx.w[0] = opcode;
+ regs.es = SEG(data);
+ regs.edi.w[0] = OFFS(data);
+ call16(pxenv, &regs, &regs);
+
+ sem_up(&pxe_sem);
+
+ return regs.eflags.l & EFLAGS_CF; /* CF SET if fail */
+}
diff --git a/core/pxeboot.c b/core/bios/pxe/pxeboot.c
index d9960d81..94d345bd 100644
--- a/core/pxeboot.c
+++ b/core/bios/pxe/pxeboot.c
@@ -10,7 +10,7 @@
*/
#include <syslinux/video.h>
-#include "pxe.h"
+#include "core_pxe.h"
#include <com32.h>
#define LOCALBOOT_MSG "Booting from local disk..."
diff --git a/core/pxeisr.inc b/core/bios/pxeisr.inc
index 93c73ed5..93c73ed5 100644
--- a/core/pxeisr.inc
+++ b/core/bios/pxeisr.inc
diff --git a/core/pxelinux-c.c b/core/bios/pxelinux-c.c
index ac23d822..ac23d822 100644
--- a/core/pxelinux-c.c
+++ b/core/bios/pxelinux-c.c
diff --git a/core/bios/pxelinux.asm b/core/bios/pxelinux.asm
new file mode 100644
index 00000000..4cfdf1a2
--- /dev/null
+++ b/core/bios/pxelinux.asm
@@ -0,0 +1,2 @@
+%define IS_LPXELINUX 0
+%include "pxelinux.inc"
diff --git a/core/pxelinux.asm b/core/bios/pxelinux.inc
index a2543dfe..be786369 100644
--- a/core/pxelinux.asm
+++ b/core/bios/pxelinux.inc
@@ -203,11 +203,6 @@ ROOT_FS_OPS:
pm_call load_env32
jmp kaboom ; load_env32() shouldn't return. If it does, then kaboom!
-print_hello:
-enter_command:
-auto_boot:
- pm_call hello
-
;
; Save hardwired DHCP options. This is done before the C environment
; is initialized, so it has to be done in assembly.
diff --git a/core/rawcon.c b/core/bios/rawcon.c
index 44030984..44030984 100644
--- a/core/rawcon.c
+++ b/core/bios/rawcon.c
diff --git a/core/regdump.inc b/core/bios/regdump.inc
index bdb5172d..bdb5172d 100644
--- a/core/regdump.inc
+++ b/core/bios/regdump.inc
diff --git a/core/rllpack.c b/core/bios/rllpack.c
index bb9f046c..bb9f046c 100644
--- a/core/rllpack.c
+++ b/core/bios/rllpack.c
diff --git a/core/serirq.c b/core/bios/serirq.c
index 22370b9c..22370b9c 100644
--- a/core/serirq.c
+++ b/core/bios/serirq.c
diff --git a/core/stack.inc b/core/bios/stack.inc
index 838d6bab..838d6bab 100644
--- a/core/stack.inc
+++ b/core/bios/stack.inc
diff --git a/core/strcpy.inc b/core/bios/strcpy.inc
index 9762cbbf..9762cbbf 100644
--- a/core/strcpy.inc
+++ b/core/bios/strcpy.inc
diff --git a/core/i386/syslinux.ld b/core/bios/syslinux.ld
index e8d32dd9..e8d32dd9 100644
--- a/core/i386/syslinux.ld
+++ b/core/bios/syslinux.ld
diff --git a/core/timer.inc b/core/bios/timer.inc
index 80647983..80647983 100644
--- a/core/timer.inc
+++ b/core/bios/timer.inc
diff --git a/core/tracers.inc b/core/bios/tracers.inc
index a51209fa..a51209fa 100644
--- a/core/tracers.inc
+++ b/core/bios/tracers.inc
diff --git a/core/writedec.inc b/core/bios/writedec.inc
index 19e47968..19e47968 100644
--- a/core/writedec.inc
+++ b/core/bios/writedec.inc
diff --git a/core/writehex.inc b/core/bios/writehex.inc
index e2bf86b4..e2bf86b4 100644
--- a/core/writehex.inc
+++ b/core/bios/writehex.inc
diff --git a/core/conio.c b/core/conio.c
index e5e0ca76..e1c14987 100644
--- a/core/conio.c
+++ b/core/conio.c
@@ -29,271 +29,11 @@
#include <x86/cpu.h>
#include <syslinux/firmware.h>
-#include "bios.h"
-#include "graphics.h"
-
-union screen _cursor;
-union screen _screensize;
-
-/*
- * Serial console stuff.
- */
-__export uint16_t SerialPort = 0; /* Serial port base (or 0 for no serial port) */
-__export uint8_t FlowInput = 0; /* Input bits for serial flow */
-__export uint16_t BaudDivisor = 115200/9600; /* Baud rate divisor */
-__export uint8_t FlowIgnore = 0; /* Ignore input unless these bits set */
-__export uint16_t DisplayCon = 0x01; /* Display console enabled */
-__export uint8_t FlowOutput = 0; /* Output to assert for serial flow */
-
-__export uint8_t DisplayMask = 0x07; /* Display modes mask */
-
-uint8_t ScrollAttribute = 0x07; /* Grey on white (normal text color) */
-
-/*
- * loadkeys: Load a LILO-style keymap
- *
- * Returns 0 on success, or -1 on error.
- */
-__export int loadkeys(const char *filename)
-{
- FILE *f;
-
- f = fopen(filename, "r");
- if (!f)
- return -1;
-
- fread(KbdMap, 1, sizeof(KbdMap), f);
-
- fclose(f);
- return 0;
-}
-
-/*
- * write_serial: If serial output is enabled, write character on
- * serial port.
- */
-__export void write_serial(char data)
-{
- if (!SerialPort)
- return;
-
- if (!(DisplayMask & 0x04))
- return;
-
- while (1) {
- char ch;
-
- ch = inb(SerialPort + 5); /* LSR */
-
- /* Wait for space in transmit register */
- if (!(ch & 0x20))
- continue;
-
- /* Wait for input flow control */
- ch = inb(SerialPort + 6);
- ch &= FlowInput;
- if (ch != FlowInput)
- continue;
-
- break;
- }
-
- outb(data, SerialPort); /* Send data */
- io_delay();
-}
-
-void pm_write_serial(com32sys_t *regs)
-{
- write_serial(regs->eax.b[0]);
-}
-
-void serialcfg(uint16_t *iobase, uint16_t *divisor, uint16_t *flowctl)
-{
- uint8_t al, ah;
-
- *iobase = SerialPort;
- *divisor = BaudDivisor;
-
- al = FlowOutput;
- ah = FlowInput;
-
- al |= ah;
- ah = FlowIgnore;
- ah >>= 4;
-
- if (!DisplayCon)
- ah |= 0x80;
-
- *flowctl = al | (ah << 8);
-}
-
-void pm_serialcfg(com32sys_t *regs)
-{
- serialcfg(&regs->eax.w[0], &regs->ecx.w[0], &regs->ebx.w[0]);
-}
-
-/*
- * write_serial_str: write_serial for strings
- */
-__export void write_serial_str(char *data)
-{
- char ch;
-
- while ((ch = *data++))
- write_serial(ch);
-}
-
-/*
- * pollchar: check if we have an input character pending
- *
- * Returns 1 if character pending.
- */
-int bios_pollchar(void)
-{
- com32sys_t ireg, oreg;
- uint8_t data = 0;
-
- memset(&ireg, 0, sizeof(ireg));
-
- ireg.eax.b[1] = 0x11; /* Poll keyboard */
- __intcall(0x16, &ireg, &oreg);
-
- if (!(oreg.eflags.l & EFLAGS_ZF))
- return 1;
-
- if (SerialPort) {
- cli();
-
- /* Already-queued input? */
- if (SerialTail == SerialHead) {
- /* LSR */
- data = inb(SerialPort + 5) & 1;
- if (data) {
- /* MSR */
- data = inb(SerialPort + 6);
-
- /* Required status bits */
- data &= FlowIgnore;
-
- if (data == FlowIgnore)
- data = 1;
- else
- data = 0;
- }
- } else
- data = 1;
- sti();
- }
-
- return data;
-}
-
__export int pollchar(void)
{
return firmware->i_ops->pollchar();
}
-void pm_pollchar(com32sys_t *regs)
-{
- if (pollchar())
- regs->eflags.l &= ~EFLAGS_ZF;
- else
- regs->eflags.l |= EFLAGS_ZF;
-}
-
-char bios_getchar(char *hi)
-{
- com32sys_t ireg, oreg;
- unsigned char data;
-
- memset(&ireg, 0, sizeof(ireg));
- memset(&oreg, 0, sizeof(oreg));
- while (1) {
- __idle();
-
- ireg.eax.b[1] = 0x11; /* Poll keyboard */
- __intcall(0x16, &ireg, &oreg);
-
- if (oreg.eflags.l & EFLAGS_ZF) {
- if (!SerialPort)
- continue;
-
- cli();
- if (SerialTail != SerialHead) {
- /* serial queued */
- sti(); /* We already know we'll consume data */
- data = *SerialTail++;
-
- if (SerialTail > SerialHead + serial_buf_size)
- SerialTail = SerialHead;
- } else {
- /* LSR */
- data = inb(SerialPort + 5) & 1;
- if (!data) {
- sti();
- continue;
- }
- data = inb(SerialPort + 6);
- data &= FlowIgnore;
- if (data != FlowIgnore) {
- sti();
- continue;
- }
-
- data = inb(SerialPort);
- sti();
- break;
- }
- } else {
- /* Keyboard input? */
- ireg.eax.b[1] = 0x10; /* Get keyboard input */
- __intcall(0x16, &ireg, &oreg);
-
- data = oreg.eax.b[0];
- *hi = oreg.eax.b[1];
-
- if (data == 0xE0)
- data = 0;
-
- if (data) {
- /* Convert character sets */
- data = KbdMap[data];
- }
- }
-
- break;
- }
-
- reset_idle(); /* Character received */
- return data;
-}
-
-uint8_t bios_shiftflags(void)
-{
- com32sys_t reg;
- uint8_t ah, al;
-
- memset(&reg, 0, sizeof reg);
- reg.eax.b[1] = 0x12;
- __intcall(0x16, &reg, &reg);
- ah = reg.eax.b[1];
- al = reg.eax.b[0];
-
- /*
- * According to the Interrupt List, "many machines" don't correctly
- * fold the Alt state, presumably because it might be AltGr.
- * Explicitly fold the Alt and Ctrl states; it fits our needs
- * better.
- */
-
- if (ah & 0x0a)
- al |= 0x08;
- if (ah & 0x05)
- al |= 0x04;
-
- return al;
-}
-
__export uint8_t kbd_shiftflags(void)
{
if (firmware->i_ops->shiftflags)
@@ -309,8 +49,3 @@ __export char getchar(char *hi)
{
return firmware->i_ops->getchar(hi);
}
-
-void pm_getchar(com32sys_t *regs)
-{
- regs->eax.b[0] = getchar((char *)&regs->eax.b[1]);
-}
diff --git a/core/elflink/elfutils.h b/core/elflink/elfutils.h
index 3c8e70fc..f641b119 100644
--- a/core/elflink/elfutils.h
+++ b/core/elflink/elfutils.h
@@ -8,20 +8,20 @@
* elf_get_header - Returns a pointer to the ELF header structure.
* @elf_image: pointer to the ELF file image in memory
*/
-static inline Elf32_Ehdr *elf_get_header(void *elf_image)
+static inline Elf_Ehdr *elf_get_header(void *elf_image)
{
- return (Elf32_Ehdr *) elf_image;
+ return (Elf_Ehdr *) elf_image;
}
/**
* elf_get_pht - Returns a pointer to the first entry in the PHT.
* @elf_image: pointer to the ELF file image in memory
*/
-static inline Elf32_Phdr *elf_get_pht(void *elf_image)
+static inline Elf_Phdr *elf_get_pht(void *elf_image)
{
- Elf32_Ehdr *elf_hdr = elf_get_header(elf_image);
+ Elf_Ehdr *elf_hdr = elf_get_header(elf_image);
- return (Elf32_Phdr *) ((Elf32_Off) elf_hdr + elf_hdr->e_phoff);
+ return (Elf_Phdr *) ((Elf_Off) elf_hdr + elf_hdr->e_phoff);
}
//
@@ -30,12 +30,12 @@ static inline Elf32_Phdr *elf_get_pht(void *elf_image)
* @elf_image: pointer to the ELF file image in memory
* @index: the index of the PHT entry to look for
*/
-static inline Elf32_Phdr *elf_get_ph(void *elf_image, int index)
+static inline Elf_Phdr *elf_get_ph(void *elf_image, int index)
{
- Elf32_Phdr *elf_pht = elf_get_pht(elf_image);
- Elf32_Ehdr *elf_hdr = elf_get_header(elf_image);
+ Elf_Phdr *elf_pht = elf_get_pht(elf_image);
+ Elf_Ehdr *elf_hdr = elf_get_header(elf_image);
- return (Elf32_Phdr *) ((Elf32_Off) elf_pht + index * elf_hdr->e_phentsize);
+ return (Elf_Phdr *) ((Elf_Off) elf_pht + index * elf_hdr->e_phentsize);
}
/**
diff --git a/core/fs/ext2/ext2.c b/core/fs/ext2/ext2.c
index 4bc0a535..6ff63642 100644
--- a/core/fs/ext2/ext2.c
+++ b/core/fs/ext2/ext2.c
@@ -29,7 +29,7 @@ static const void *__ext2_get_group_desc(struct fs_info *fs, uint32_t group_num)
{
struct ext2_sb_info *sbi = EXT2_SB(fs);
uint32_t desc_block, desc_index;
- uint8_t *p;
+ const uint8_t *p;
if (group_num >= sbi->s_groups_count) {
printf ("ext2_get_group_desc"
diff --git a/core/fs/ntfs/ntfs.c b/core/fs/ntfs/ntfs.c
index 4c0a09c8..54213668 100644
--- a/core/fs/ntfs/ntfs.c
+++ b/core/fs/ntfs/ntfs.c
@@ -671,8 +671,6 @@ static int index_inode_setup(struct fs_info *fs, unsigned long mft_no,
NTFS_PVT(inode)->type = attr->type;
if (!attr->non_resident) {
- NTFS_PVT(inode)->data.resident.offset =
- (uint32_t)((uint8_t *)attr + attr->data.resident.value_offset);
inode->size = attr->data.resident.value_len;
} else {
attr_len = (uint8_t *)attr + attr->len;
diff --git a/core/fs/ntfs/ntfs.h b/core/fs/ntfs/ntfs.h
index 721a78d7..ec1dc120 100644
--- a/core/fs/ntfs/ntfs.h
+++ b/core/fs/ntfs/ntfs.h
@@ -86,9 +86,6 @@ struct ntfs_inode {
uint32_t type; /* Attribute type of this inode */
uint8_t non_resident;
union { /* Non-resident $DATA attribute */
- struct { /* Used only if non_resident flags isn't set */
- uint32_t offset; /* Data offset */
- } resident;
struct { /* Used only if non_resident is set */
struct runlist *rlist;
} non_resident;
diff --git a/core/fs/pxe/dhcp_option.c b/core/fs/pxe/dhcp_option.c
index 1b8ec9d8..88102cbe 100644
--- a/core/fs/pxe/dhcp_option.c
+++ b/core/fs/pxe/dhcp_option.c
@@ -4,7 +4,7 @@
#include <x86/cpu.h>
#include <lwip/opt.h> /* DNS_MAX_SERVERS */
#include <dprintf.h>
-#include "pxe.h"
+#include "core_pxe.h"
char LocalDomain[256];
@@ -231,13 +231,10 @@ void parse_dhcp(const void *pkt, size_t pkt_len, int pkt_type)
{
const struct bootp_t *dhcp = (const struct bootp_t *)pkt;
int opt_len;
- int min_opt = 0;
IPInfo.ipver = 4; /* This is IPv4 only for now... */
over_load = 0;
- if (pkt_type == 1 || pkt_type == 3)
- min_opt = 43;
if ((pkt_type == 2) && ip_ok(dhcp->yip))
IPInfo.myip = dhcp->yip;
diff --git a/core/fs/pxe/ftp.c b/core/fs/pxe/ftp.c
index 947f2899..6893e540 100644
--- a/core/fs/pxe/ftp.c
+++ b/core/fs/pxe/ftp.c
@@ -23,7 +23,7 @@
#include <lwip/api.h>
#include "core.h"
#include "fs.h"
-#include "pxe.h"
+#include "core_pxe.h"
#include "thread.h"
#include "url.h"
#include "net.h"
diff --git a/core/fs/pxe/ftp_readdir.c b/core/fs/pxe/ftp_readdir.c
index 6b87f77e..04091cf2 100644
--- a/core/fs/pxe/ftp_readdir.c
+++ b/core/fs/pxe/ftp_readdir.c
@@ -18,7 +18,7 @@
#include <stdlib.h>
#include <ctype.h>
#include <dprintf.h>
-#include "pxe.h"
+#include "core_pxe.h"
static int dirtype(char type)
{
diff --git a/core/fs/pxe/gpxeurl.c b/core/fs/pxe/gpxeurl.c
index d030a803..5b8414fe 100644
--- a/core/fs/pxe/gpxeurl.c
+++ b/core/fs/pxe/gpxeurl.c
@@ -1,10 +1,11 @@
-#include "pxe.h"
-#if GPXE
+/*
+ * Dummy gPXE stub
+ */
-void gpxe_open(struct inode *inode, const char *url)
+#include "core_pxe.h"
+
+void __attribute__((weak)) gpxe_open(struct inode *inode, const char *url)
{
(void)inode;
(void)url;
}
-
-#endif /* GPXE */
diff --git a/core/fs/pxe/http.c b/core/fs/pxe/http.c
index f5f49e2b..5b8fce11 100644
--- a/core/fs/pxe/http.c
+++ b/core/fs/pxe/http.c
@@ -1,7 +1,7 @@
#include <syslinux/sysappend.h>
#include <ctype.h>
#include <lwip/api.h>
-#include "pxe.h"
+#include "core_pxe.h"
#include "version.h"
#include "url.h"
#include "net.h"
diff --git a/core/fs/pxe/http_readdir.c b/core/fs/pxe/http_readdir.c
index b6e480e7..88496201 100644
--- a/core/fs/pxe/http_readdir.c
+++ b/core/fs/pxe/http_readdir.c
@@ -15,7 +15,7 @@
#include <stdlib.h>
#include <ctype.h>
#include <dprintf.h>
-#include "pxe.h"
+#include "core_pxe.h"
enum http_readdir_state {
st_start, /* 0 Initial state */
diff --git a/core/fs/pxe/idle.c b/core/fs/pxe/idle.c
index dbc5b9ab..d767009a 100644
--- a/core/fs/pxe/idle.c
+++ b/core/fs/pxe/idle.c
@@ -11,19 +11,23 @@
*
* ----------------------------------------------------------------------- */
+/*
+ * Fallback empty idle routine, marked weak so it can be overridden
+ */
+
#include <stdio.h>
#include <string.h>
#include <core.h>
#include <fs.h>
#include <minmax.h>
#include <x86/cpu.h>
-#include "pxe.h"
+#include "core_pxe.h"
-void pxe_idle_init(void)
+void __attribute__((weak)) pxe_idle_init(void)
{
}
-void pxe_idle_cleanup(void)
+void __attribute__((weak)) pxe_idle_cleanup(void)
{
idle_hook_func = NULL;
}
diff --git a/core/fs/pxe/pxe.c b/core/fs/pxe/pxe.c
index 685fcc8f..a8f38559 100644
--- a/core/fs/pxe/pxe.c
+++ b/core/fs/pxe/pxe.c
@@ -5,7 +5,7 @@
#include <fs.h>
#include <fcntl.h>
#include <x86/cpu.h>
-#include "pxe.h"
+#include "core_pxe.h"
#include "thread.h"
#include "url.h"
#include "tftp.h"
@@ -99,33 +99,6 @@ static int gendotquad(char *dst, uint32_t ip)
}
/*
- * the ASM pxenv function wrapper, return 1 if error, or 0
- *
- */
-__export int pxe_call(int opcode, void *data)
-{
- static DECLARE_INIT_SEMAPHORE(pxe_sem, 1);
- extern void pxenv(void);
- com32sys_t regs;
-
- sem_down(&pxe_sem, 0);
-
-#if 0
- dprintf("pxe_call op %04x data %p\n", opcode, data);
-#endif
-
- memset(&regs, 0, sizeof regs);
- regs.ebx.w[0] = opcode;
- regs.es = SEG(data);
- regs.edi.w[0] = OFFS(data);
- call16(pxenv, &regs, &regs);
-
- sem_up(&pxe_sem);
-
- return regs.eflags.l & EFLAGS_CF; /* CF SET if fail */
-}
-
-/*
* mangle a filename pointed to by _src_ into a buffer pointed
* to by _dst_; ends on encountering any whitespace.
*
diff --git a/core/fs/pxe/tftp.c b/core/fs/pxe/tftp.c
index 594152b9..472988b4 100644
--- a/core/fs/pxe/tftp.c
+++ b/core/fs/pxe/tftp.c
@@ -1,6 +1,6 @@
#include <minmax.h>
#include <net.h>
-#include "pxe.h"
+#include "core_pxe.h"
#include "url.h"
#include "tftp.h"
diff --git a/core/fs/pxe/pxe.h b/core/include/core_pxe.h
index 19664f9b..19664f9b 100644
--- a/core/fs/pxe/pxe.h
+++ b/core/include/core_pxe.h
diff --git a/core/strcasecmp.c b/core/strcasecmp.c
deleted file mode 100644
index 2f7480d4..00000000
--- a/core/strcasecmp.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * strcasecmp.c
- */
-
-#include <string.h>
-#include <ctype.h>
-
-int strcasecmp(const char *s1, const char *s2)
-{
- return strncasecmp(s1, s2, -1);
-}
diff --git a/core/hello.c b/core/tests/hello.c
index bed7cb59..bed7cb59 100644
--- a/core/hello.c
+++ b/core/tests/hello.c
diff --git a/diag/geodsp/Makefile b/diag/geodsp/Makefile
index 73e4429e..92d6be2d 100644
--- a/diag/geodsp/Makefile
+++ b/diag/geodsp/Makefile
@@ -19,7 +19,7 @@
#
include $(MAKEDIR)/embedded.mk
-coredir = $(topdir)/core
+coredir = $(topdir)/core/bios
VPATH = $(SRC)
BTARGET = geodsp1s.bin geodsp1s_f.bin geodspms.bin \
@@ -28,7 +28,7 @@ BTARGET = geodsp1s.bin geodsp1s_f.bin geodspms.bin \
NASMOPT = -i $(coredir)/ -i $(SRC)/ -Ox -f bin -dBINFMT
NASMOPT += -w+orphan-labels
CFLAGS = -g -O
-LIBS = $(coredir)/writehex.inc $(coredir)/macros.inc $(coredir)/diskboot.inc geodsplib.inc
+LIBS = $(wildcard $(coredir)/*.inc)
all: $(BTARGET)
diff --git a/efi/Makefile b/efi/Makefile
index f4501e7f..00fab618 100644
--- a/efi/Makefile
+++ b/efi/Makefile
@@ -19,29 +19,16 @@ CC_FOR_BUILD ?= $(CC)
# Upstream gnu-efi has old-style function definitions.
CFLAGS += -Wno-strict-prototypes
-CORE_CSRC := $(sort $(wildcard $(core)/*.c $(core)/*/*.c $(core)/*/*/*.c))
+CORE_CSRC := $(sort $(shell find '$(core)' -name '*.c' -print))
CORE_COBJ := $(subst $(core),$(OBJ)/../core,$(patsubst %.c,%.o,$(CORE_CSRC)))
# We don't want to include any of the networking stack or the thread
# code since it will be implemented completely differently for EFI.
-FILTERED_OBJS:= $(sort $(subst $(core),$(OBJ)/../core,$(patsubst %.c,%.o, \
- $(wildcard $(core)/legacynet/*.c) \
- $(wildcard $(core)/fs/pxe/*.c) \
- $(wildcard $(core)/thread/*.c))))
-
-# Don't include unit tests
-FILTERED_OBJS += $(subst $(core),$(OBJ)/../core, \
- $(patsubst %.c,%.o,$(shell find $(core) -path "*/tests/*.c" -print)))
-
-# Don't include console objects
-CORE_OBJS = $(filter-out %hello.o %rawcon.o %plaincon.o %strcasecmp.o %bios.o \
- %diskio_bios.o %ldlinux-c.o %isolinux-c.o %pxelinux-c.o \
- %localboot.o %pxeboot.o \
- $(FILTERED_OBJS),$(CORE_COBJ) $(CORE_SOBJ))
-
-CORE_OBJS += $(addprefix $(OBJ)/../core/, \
- fs/pxe/pxe.o fs/pxe/tftp.o fs/pxe/urlparse.o fs/pxe/dhcp_option.o \
- fs/pxe/ftp.o fs/pxe/ftp_readdir.o fs/pxe/http.o fs/pxe/http_readdir.o)
+FILTERED_OBJS := $(OBJ)/../core/bios/% \
+ $(patsubst $(core)/%,$(OBJ)/../core/%/%,\
+ $(shell find '$(core)' -type d -name tests))
+
+CORE_OBJS = $(filter-out $(FILTERED_OBJS),$(CORE_COBJ))
LIB_OBJS = $(addprefix $(objdir)/com32/lib/,$(CORELIBOBJS)) \
$(LIBEFI)
diff --git a/efi/main.c b/efi/main.c
index 92546de6..6a748412 100644
--- a/efi/main.c
+++ b/efi/main.c
@@ -169,9 +169,11 @@ void efi_destroy_binding(struct efi_binding *b, EFI_GUID *guid)
free(b);
}
-#undef kaboom
-void kaboom(void)
+__export __noreturn _kaboom(void)
{
+ /* Return to EFI here somehow? */
+ for (;;)
+ asm volatile("hlt");
}
void printf_init(void)
@@ -1237,7 +1239,10 @@ bail:
}
extern struct disk *efi_disk_init(EFI_HANDLE);
-extern void serialcfg(uint16_t *, uint16_t *, uint16_t *);
+static void serialcfg(uint16_t *iobase, uint16_t *divisor, uint16_t *flowctl)
+{
+ *iobase = *divisor = *flowctl = 0;
+}
extern struct vesa_ops efi_vesa_ops;
diff --git a/efi/pxe.c b/efi/pxe.c
index 6e59109b..5b552b39 100644
--- a/efi/pxe.c
+++ b/efi/pxe.c
@@ -6,7 +6,7 @@
#include <syslinux/pxe_api.h>
#include "efi.h"
#include "net.h"
-#include "fs/pxe/pxe.h"
+#include "core_pxe.h"
const struct url_scheme url_schemes[] = {
{ "tftp", tftp_open, 0 },
diff --git a/efi/tcp.c b/efi/tcp.c
index 0e9140e4..6ac4f0d3 100644
--- a/efi/tcp.c
+++ b/efi/tcp.c
@@ -4,7 +4,7 @@
#include "efi.h"
#include "net.h"
-#include "fs/pxe/pxe.h"
+#include "core_pxe.h"
extern EFI_GUID Tcp4ServiceBindingProtocol;
extern EFI_GUID Tcp4Protocol;
diff --git a/efi/udp.c b/efi/udp.c
index 288010cf..be2f2f2a 100644
--- a/efi/udp.c
+++ b/efi/udp.c
@@ -6,7 +6,7 @@
#include <minmax.h>
#include "efi.h"
#include "net.h"
-#include "fs/pxe/pxe.h"
+#include "core_pxe.h"
extern EFI_GUID Udp4ServiceBindingProtocol, Udp4Protocol;
diff --git a/mk/syslinux.mk b/mk/syslinux.mk
index d4a2e079..593ff75f 100644
--- a/mk/syslinux.mk
+++ b/mk/syslinux.mk
@@ -1,4 +1,4 @@
-## -*- makefile -*- -------------------------------------------------------
+## -*- makefile -*- ------------------------------------------------------
##
## Copyright 2008 H. Peter Anvin - All Rights Reserved
##
@@ -80,14 +80,17 @@ ARCH ?= $(strip $(SUBARCH))
# Common warnings we want for all gcc-generated code
# WARNOPT is available for the user to specify additional warning flags
-GCCWARN = -W -Wall -Wstrict-prototypes $(DEBUGOPT) $(WARNOPT)
+GCCWARN = -W -Wall -Wstrict-prototypes \
+ -Wno-implicit-fallthrough -Wno-format-truncation \
+ -Wno-stringop-overflow \
+ $(DEBUGOPT) $(WARNOPT)
# Common stanza to make gcc generate .*.d dependency files
-MAKEDEPS = -MT $@ -MD -MF $(dir $@).$(notdir $@).d
+MAKEDEPS = -MT $@ -MD -MF $(@D)/.$(@F).d
# Dependencies that exclude system headers; use whenever we use
# header files from the platform.
-UMAKEDEPS = -MT $@ -MMD -MF $(dir $@).$(notdir $@).d
+UMAKEDEPS = -MT $@ -MMD -MF $(@D)/.$(@F).d
# Items that are only appropriate during development; this file is
# removed when tarballs are generated.