summaryrefslogtreecommitdiff
path: root/lib/libstand
Commit message (Collapse)AuthorAgeFilesLines
* MFC 205900:John Baldwin2010-04-141-4/+4
| | | | | | | | | | Use panic() (which the environment is required to provide to libstand) to implement assert() instead of relying on a non-required exit(). The exit() invocation also did not match the semantics of the exit() routine that current boot environments happen to require. Notes: svn path=/stable/8/; revision=206611
* MFC r202585: fix a comment typoAndriy Gapon2010-01-221-1/+1
| | | | Notes: svn path=/stable/8/; revision=202787
* MFC rev 201937:Marcel Moolenaar2010-01-161-1/+68
| | | | | | | Implement the fo_readdir method. Notes: svn path=/stable/8/; revision=202429
* MFC 200919:John Baldwin2009-12-302-16/+67
| | | | | | | | | Fix a bug in gzipfs that prevented lseek() from working and add lseek() support to bzip2fs. This fixes problems with loading compressed amd64 kernel modules containing debug symbols. Notes: svn path=/stable/8/; revision=201267
* MFC: r198542Christian Brueffer2009-11-041-0/+1
| | | | | | | | Initialize f_rabuf in the raw device case. A subsequent close() later on would try to free it, leading to a crash. Notes: svn path=/stable/8/; revision=198888
* Fix minor issues in libstand.Ed Schouten2009-05-312-2/+2
| | | | | | | | | | - Don't call tftp_makereq() with too many arguments. - Don't forget to close one of the comments. Submitted by: Pawel Worach Notes: svn path=/head/; revision=193189
* Use GCC's __SOFTFP__ to test whether we're being compiledMarcel Moolenaar2009-05-311-1/+1
| | | | | | | | with softfloat or not. Now -msoft-float can be overridden more easily. Notes: svn path=/head/; revision=193145
* Print the returned port number when RPC_DEBUG is defined.Marcel Moolenaar2009-05-301-4/+11
| | | | | | | This improves debugging. Notes: svn path=/head/; revision=193109
* Use, in uncovered part, the END() macro in order to improve debugging.Attilio Rao2009-05-251-0/+2
| | | | | | | | | | | | In this specific case, Valgrind won't get confused when analyzing such functions. Sponsored by: Sandvine Incorporated Tested by: emaste MFC: 3 days Notes: svn path=/head/; revision=192760
* Increase the number of available file descriptors to 64. This fixes theDoug Rabson2009-05-241-1/+1
| | | | | | | | reported zfsboot problems for systems where more than seven drives are part of ZFS pools. Notes: svn path=/head/; revision=192679
* Fix an off-by-one buffer overflow in ngets().John Baldwin2009-03-311-1/+1
| | | | | | | | Submitted by: Bruce Can MFC after: 1 month Notes: svn path=/head/; revision=190593
* Fix build when WITH_SSP is set explicitly.Ruslan Ermilov2009-02-211-1/+3
| | | | | | | Submitted by: Jeremie Le Hen Notes: svn path=/head/; revision=188895
* put a prefix on dhcp options to avoid clobbering, even by mistake,Luigi Rizzo2009-01-051-1/+1
| | | | | | | | | existing environment variables. MFC after: 2 weeks Notes: svn path=/head/; revision=186799
* This main goals of this project are:Qing Li2008-12-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. separating L2 tables (ARP, NDP) from the L3 routing tables 2. removing as much locking dependencies among these layers as possible to allow for some parallelism in the search operations 3. simplify the logic in the routing code, The most notable end result is the obsolescent of the route cloning (RTF_CLONING) concept, which translated into code reduction in both IPv4 ARP and IPv6 NDP related modules, and size reduction in struct rtentry{}. The change in design obsoletes the semantics of RTF_CLONING, RTF_WASCLONE and RTF_LLINFO routing flags. The userland applications such as "arp" and "ndp" have been modified to reflect those changes. The output from "netstat -r" shows only the routing entries. Quite a few developers have contributed to this project in the past: Glebius Smirnoff, Luigi Rizzo, Alessandro Cerri, and Andre Oppermann. And most recently: - Kip Macy revised the locking code completely, thus completing the last piece of the puzzle, Kip has also been conducting active functional testing - Sam Leffler has helped me improving/refactoring the code, and provided valuable reviews - Julian Elischer setup the perforce tree for me and has helped me maintaining that branch before the svn conversion Notes: svn path=/head/; revision=186119
* Some libstand/bootp.c extension (written by Danny Braniss, slightlyLuigi Rizzo2008-12-051-0/+328
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | revised/modified by me) to store dhcp options into kenv variables, so the information is available to the boot loader and can be used to customize the boot process. The change is totally unintrusive, essentially made of a single function to be called while parsing a dhcp response, and a couple of tables to classify options. The values extracted from dhcp options are stored in the kenv environment in one of these forms: + options whose name and type is known are saved as dhcp.name = value (string, or number/ip addresses lists) + unknown options are assumed to be strings and saved as dhcp.option-NNN = "value" + options listed as '__INDIR' and sent on the wire as e.g. option unknown-252 "some.name=the actual value" are saved as some.name = "the actual value" + options listed as '__ILIST' and sent on the wire as e.g. option unknown-249 "a.b=foo bar; c.d= 123; e.f=done" are saved as multiple values a.b="foo bar" c.d="123" e.f="done" As you can see there is quite a bit of flexibility on what can be passed to the loader or the kernel. For the time being the vendor-specific table is mostly disabled, because there is no standard set of options for FreeBSD, and I don't know all the pxe-specific vendor options. Also, applications using libstand may live in memory-constrained environments, so it makes sense to keep these tables as small as possible, especially considering that one can generate arbitrary name=value pairs using site-specific options of type __INDIR or __ILIST (there are 4 __ILIST and 5 __INDIR in the table, numbered 246..249 and 250..254). Actually, considering that probably 75% of the standard dhcp options are totally useless, it might make sense to remove them as well. Submitted by: Danny Braniss MFC after: 4 weeks Notes: svn path=/head/; revision=185643
* use the correct variable in a debug message.Luigi Rizzo2008-11-211-1/+1
| | | | Notes: svn path=/head/; revision=185155
* Obey signedness flag in %z case.Xin LI2008-11-181-1/+1
| | | | | | | MFC after: 2 months Notes: svn path=/head/; revision=185037
* Eliminate dead declarations in libstand.Rafal Jaworowski2008-11-061-4/+0
| | | | Notes: svn path=/head/; revision=184732
* Let libstand(3) build on ARM.Rafal Jaworowski2008-10-141-1/+9
| | | | | | | This is a pre-requisite for loader(8) + U-Boot support library on this arch. Notes: svn path=/head/; revision=183876
* Eliminate __alpha__ leftover from libstand.Rafal Jaworowski2008-09-043-16/+0
| | | | Notes: svn path=/head/; revision=182748
* Add the needed _setjmp.S for MIPS.David E. O'Brien2008-08-271-0/+139
| | | | | | | Obtained from: Juniper Networks Notes: svn path=/head/; revision=182290
* Enable GCC stack protection (aka Propolice) for userland:Ruslan Ermilov2008-06-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | - It is opt-out for now so as to give it maximum testing, but it may be turned opt-in for stable branches depending on the consensus. You can turn it off with WITHOUT_SSP. - WITHOUT_SSP was previously used to disable the build of GNU libssp. It is harmless to steal the knob as SSP symbols have been provided by libc for a long time, GNU libssp should not have been much used. - SSP is disabled in a few corners such as system bootstrap programs (sys/boot), process bootstrap code (rtld, csu) and SSP symbols themselves. - It should be safe to use -fstack-protector-all to build world, however libc will be automatically downgraded to -fstack-protector because it breaks rtld otherwise. - This option is unavailable on ia64. Enable GCC stack protection (aka Propolice) for kernel: - It is opt-out for now so as to give it maximum testing. - Do not compile your kernel with -fstack-protector-all, it won't work. Submitted by: Jeremie Le Hen <jeremie@le-hen.org> Notes: svn path=/head/; revision=180012
* _setjmp.o was missing a dependency on "machine".Ruslan Ermilov2008-04-291-3/+1
| | | | Notes: svn path=/head/; revision=178664
* Don't forget to clean the "machine" symlink on amd64, otherwise badRuslan Ermilov2008-04-291-0/+3
| | | | | | | | | | things may happen. Reported by: phk MFC after: 3 days Notes: svn path=/head/; revision=178663
* On i386, don't try to do network-type stuff if the device name is'nt pxeN.Doug Rabson2008-04-051-0/+7
| | | | Notes: svn path=/head/; revision=177935
* Fix logical bug in the bzip2 reading code, which results in bogus EIOMaxim Sobolev2007-12-182-2/+48
| | | | | | | | | | | | | | | | | | | | | | | | returned on a perfectly valid bzip2 stream whose decompressed size is multiple of read-ahead buffer size. Reproduce the problem is easy: create some power-of-two sized file (truncate -s 1m file will do), bzip2 it and try to load it as md_image from loader. See how it fails. The bug doesn't affect gzip code (which most of bzip2-reading code was copied from) probably due to the fact that libgzip doesn't report Z_STREAM_END with the last block, but requires extra call to inflate() to retrieve it and has some extra data in the input stream at that time. However, apply similar fix to gzipfs.c just in the case the API will change in the future to do what bzip2 code does. Add some ifdef'ed code to enable testing bzipfs.c from witin normal FreeBSD environment as opposed to the restricted loader one, so that one can use gdb and whatnot. Sponsored by: Sippy Software, Inc., http://www.sippysoft.com/ MFC in: 7 days Notes: svn path=/head/; revision=174741
* First cut at support for booting a GPT labeled disk via the BIOS bootstrapJohn Baldwin2007-10-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on i386 and amd64 machines. The overall process is that /boot/pmbr lives in the PMBR (similar to /boot/mbr for MBR disks) and is responsible for locating and loading /boot/gptboot. /boot/gptboot is similar to /boot/boot except that it groks GPT rather than MBR + bsdlabel. Unlike /boot/boot, /boot/gptboot lives in its own dedicated GPT partition with a new "FreeBSD boot" type. This partition does not have a fixed size in that /boot/pmbr will load the entire partition into the lower 640k. However, it is limited in that it can only be 545k. That's still a lot better than the current 7.5k limit for boot2 on MBR. gptboot mostly acts just like boot2 in that it reads /boot.config and loads up /boot/loader. Some more details: - Include uuid_equal() and uuid_is_nil() in libstand. - Add a new 'boot' command to gpt(8) which makes a GPT disk bootable using /boot/pmbr and /boot/gptboot. Note that the disk must have some free space for the boot partition. - This required exposing the backend of the 'add' function as a gpt_add_part() function to the rest of gpt(8). 'boot' uses this to create a boot partition if needed. - Don't cripple cgbase() in the UFS boot code for /boot/gptboot so that it can handle a filesystem > 1.5 TB. - /boot/gptboot has a simple loader (gptldr) that doesn't do any I/O unlike boot1 since /boot/pmbr loads all of gptboot up front. The C portion of gptboot (gptboot.c) has been repocopied from boot2.c. The primary changes are to parse the GPT to find a root filesystem and to use 64-bit disk addresses. Currently gptboot assumes that the first UFS partition on the disk is the / filesystem, but this algorithm will likely be improved in the future. - Teach the biosdisk driver in /boot/loader to understand GPT tables. GPT partitions are identified as 'disk0pX:' (e.g. disk0p2:) which is similar to the /dev names the kernel uses (e.g. /dev/ad0p2). - Add a new "freebsd-boot" alias to g_part() for the new boot UUID. MFC after: 1 month Discussed with: marcel (some things might still change, but am committing what I have so far) Notes: svn path=/head/; revision=172940
* - Given that we tell the compiler that struct ip is packed and 32-bitMarius Strobl2007-10-211-4/+4
| | | | | | | | | | | | | | | | | | | | aligned, GCC 4.2.1 also generates code for sendudp() that assumes this alignment. GCC 4.2.1 however doesn't 32-bit align wbuf, causing the loader to crash due to an unaligned access of wbuf in sendudp() when netbooting sparc64. Solve this by specifying wbuf as packed and 32-bit aligned, too. As for lastdata and readudp() this currently is no issue when compiled with GCC 4.2.1, though give lastdata the same treatment as wbuf for consistency and possibility of being affected in the future. [1] - Sprinkle const on a lookup table. Reported by: marcel [1] Submitted by: yongari [1] Reviewed by: marcel [1] MFC after: 5 days Notes: svn path=/head/; revision=172854
* Optimize for size on pc98. It enables to boot a kernel again.Yoshihiro Takahashi2007-10-151-0/+3
| | | | | | | | | | | I don't know what's wrong (loader, boot2 or others), but this change is effective. Tested by: NAKAJI Hiroyuki MFC after: 3 days Notes: svn path=/head/; revision=172664
* Cast away const qualifier to squash GCC warning.Alexander Kabaev2007-04-041-1/+1
| | | | Notes: svn path=/head/; revision=168348
* Remove California Regent's clause 3, per letterWarner Losh2007-01-0942-168/+8
| | | | Notes: svn path=/head/; revision=165906
* Instead of re-implementing hton[ls] and friends for each arch, add a new MIOlivier Houchard2006-11-061-7/+3
| | | | | | | | | | file, net/ntoh.c, which just implement them using the inline functions from <sys/endian.h>. Suggested by: bde Notes: svn path=/head/; revision=164053
* Remove alpha left-overs.Ruslan Ermilov2006-08-222-170/+0
| | | | Notes: svn path=/head/; revision=161526
* Implement printf 'X' conversion for both libstand and kernel.Jung-uk Kim2006-03-091-9/+11
| | | | Notes: svn path=/head/; revision=156518
* Fix prototypes.Ruslan Ermilov2005-11-241-6/+6
| | | | Notes: svn path=/head/; revision=152762
* Implement the full range of ISO9660 number conversion routines in iso.h.Dag-Erling Smørgrav2005-10-181-15/+0
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=151447
* Add -mno-sse3 for prescott/noconaAndrey A. Chernov2005-07-151-0/+3
| | | | Notes: svn path=/head/; revision=148047
* Match sys/boot in ensure GCC does not use x86 FP registers in integer code.David E. O'Brien2005-06-031-1/+2
| | | | | | | Submitted by: Pawel Worach <pawel.worach@gmail.com> Notes: svn path=/head/; revision=146917
* Back out revision 1.51, it is wrong. We don't litter -I's within libDavid E. O'Brien2005-05-311-1/+1
| | | | | | | Makefiles to get headers from /usr/src vs. the standard include paths. Notes: svn path=/head/; revision=146839
* Use %z to print size_t values.John Baldwin2005-05-312-2/+2
| | | | Notes: svn path=/head/; revision=146835
* Just use uintptr_t and intptr_t rather than requiring each arch to provideJohn Baldwin2005-05-311-24/+2
| | | | | | | explicit int/long typedefs. Notes: svn path=/head/; revision=146834
* Make bzip2 support working again after bzip2 upgrade. This time commitMaxim Sobolev2005-05-291-4/+19
| | | | | | | | | | | | | | | BZ_NO_COMPRESS support to the bzip2 sources directly (yes, this takes file off the vendor branch, but looks like bzip2 maintainer doesn't care), so that it will not be removed when the next upgrade is performed. Also, add a short note on how to test bzip2 support. Pointy hat to: obrien Correct comment (libz -> libbz2) and remove useless full path to zutil.h while I am here. Notes: svn path=/head/; revision=146788
* Add missed ${.CURDIR}/../../contrib/bzip2 into include search path, otherwiseMaxim Sobolev2005-05-291-1/+1
| | | | | | | old version of bzlib.h can be picked up from the /usr/include. Notes: svn path=/head/; revision=146784
* Remove unused variable. Shorten the path to WARNS=6 compliance.Philippe Charnier2005-05-201-1/+2
| | | | Notes: svn path=/head/; revision=146443
* Fix libstand on amd64. Rev 1.46 (obrien) removed the -I. that thePeter Wemm2005-05-201-1/+1
| | | | | | | | | | bzip2 support provided, and amd64 depended on. Amd64 has a custom ${.OBJDIR}/machine symlink in it and the -I. picked this up. Without it, the libstand code was being compiled in 32 bit mode, but with 64 bit machine headers. Notes: svn path=/head/; revision=146425
* Clean up an additional file.David E. O'Brien2005-05-171-0/+1
| | | | Notes: svn path=/head/; revision=146328
* Don't use a patch w/in /usr/src. Programmatically change files when needed.David E. O'Brien2005-05-173-26/+15
| | | | Notes: svn path=/head/; revision=146327
* Re-enable support for bzip2'ed compressed filesystems.David E. O'Brien2005-05-172-6/+11
| | | | Notes: svn path=/head/; revision=146324
* Temporarily disable support for bzip2'ed compressed filesystems, until aDavid E. O'Brien2005-05-174-117/+1
| | | | | | | maintainable why of handling them is created. Notes: svn path=/head/; revision=146308
* Sort sections.Ruslan Ermilov2005-01-201-2/+2
| | | | Notes: svn path=/head/; revision=140505