summaryrefslogtreecommitdiffstats
path: root/lib/libstand
Commit message (Collapse)AuthorAgeFilesLines
* Let libstand(3) build on ARM.raj2008-10-141-1/+9
| | | | This is a pre-requisite for loader(8) + U-Boot support library on this arch.
* Eliminate __alpha__ leftover from libstand.raj2008-09-043-16/+0
|
* Add the needed _setjmp.S for MIPS.obrien2008-08-271-0/+139
| | | | Obtained from: Juniper Networks
* Enable GCC stack protection (aka Propolice) for userland:ru2008-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>
* _setjmp.o was missing a dependency on "machine".ru2008-04-291-3/+1
|
* Don't forget to clean the "machine" symlink on amd64, otherwise badru2008-04-291-0/+3
| | | | | | | things may happen. Reported by: phk MFC after: 3 days
* On i386, don't try to do network-type stuff if the device name is'nt pxeN.dfr2008-04-051-0/+7
|
* Fix logical bug in the bzip2 reading code, which results in bogus EIOsobomax2007-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
* First cut at support for booting a GPT labeled disk via the BIOS bootstrapjhb2007-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)
* - Given that we tell the compiler that struct ip is packed and 32-bitmarius2007-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
* Optimize for size on pc98. It enables to boot a kernel again.nyan2007-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
* Cast away const qualifier to squash GCC warning.kan2007-04-041-1/+1
|
* Remove California Regent's clause 3, per letterimp2007-01-0942-168/+8
|
* Instead of re-implementing hton[ls] and friends for each arch, add a new MIcognet2006-11-061-7/+3
| | | | | | | file, net/ntoh.c, which just implement them using the inline functions from <sys/endian.h>. Suggested by: bde
* Remove alpha left-overs.ru2006-08-222-170/+0
|
* Implement printf 'X' conversion for both libstand and kernel.jkim2006-03-091-9/+11
|
* Fix prototypes.ru2005-11-241-6/+6
|
* Implement the full range of ISO9660 number conversion routines in iso.h.des2005-10-181-15/+0
| | | | MFC after: 2 weeks
* Add -mno-sse3 for prescott/noconaache2005-07-151-0/+3
|
* Match sys/boot in ensure GCC does not use x86 FP registers in integer code.obrien2005-06-031-1/+2
| | | | Submitted by: Pawel Worach <pawel.worach@gmail.com>
* Back out revision 1.51, it is wrong. We don't litter -I's within libobrien2005-05-311-1/+1
| | | | Makefiles to get headers from /usr/src vs. the standard include paths.
* Use %z to print size_t values.jhb2005-05-312-2/+2
|
* Just use uintptr_t and intptr_t rather than requiring each arch to providejhb2005-05-311-24/+2
| | | | explicit int/long typedefs.
* Make bzip2 support working again after bzip2 upgrade. This time commitsobomax2005-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.
* Add missed ${.CURDIR}/../../contrib/bzip2 into include search path, otherwisesobomax2005-05-291-1/+1
| | | | old version of bzlib.h can be picked up from the /usr/include.
* Remove unused variable. Shorten the path to WARNS=6 compliance.charnier2005-05-201-1/+2
|
* Fix libstand on amd64. Rev 1.46 (obrien) removed the -I. that thepeter2005-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.
* Clean up an additional file.obrien2005-05-171-0/+1
|
* Don't use a patch w/in /usr/src. Programmatically change files when needed.obrien2005-05-173-26/+15
|
* Re-enable support for bzip2'ed compressed filesystems.obrien2005-05-172-6/+11
|
* Temporarily disable support for bzip2'ed compressed filesystems, until aobrien2005-05-174-117/+1
| | | | maintainable why of handling them is created.
* Sort sections.ru2005-01-201-2/+2
|
* Various markup and spelling fixes.trhodes2004-12-291-0/+1
| | | | | PR: 75574 Submitted by: Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp> (original version)
* NODOCCOMPRESS -> NO_DOCCOMPRESSru2004-12-211-2/+2
| | | | | | | | NOINFO -> NO_INFO NOINFOCOMPRESS -> NO_INFOCOMPRESS NOLINT -> NO_LINT NOPIC -> NO_PIC NOPROFILE -> NO_PROFILE
* For variables that are only checked with defined(), don't provideru2004-10-241-2/+2
| | | | any fake value.
* Don't add integers to void pointers.stefanf2004-10-036-7/+7
|
* Prefer C99's __func__ over GCC's __FUNCTION__.stefanf2004-09-221-2/+2
|
* Reset the seek pointer to 0 when a file is successfully opened,iedowse2004-09-041-0/+2
| | | | | | | | | | | | | since otherwise the initial seek offset will contain the directory offset of the filesystem block that contained its directory entry. This bug was mostly harmless because typically the directory is less than one filesystem block in size so the offset would be zero. It did however generally break loading a kernel from the (large) kernel compile directory. Also reset the seek pointer when a new inode is opened in read_inode(), though this is not actually necessary now because all callers set it afterwards.
* Bump the document date, since the content changed today.roam2004-08-061-1/+1
| | | | Discussed with: ru
* Fix a printf("%b", ..) example.roam2004-08-061-2/+2
| | | | | | PR: 68849 Submitted by: Michel Lavondes <fox@vader.aacc.cc.md.us> MFC after: 1 week
* Eliminate double whitespace.ru2004-07-031-3/+3
|
* Mechanically kill hard sentence breaks.ru2004-07-021-29/+56
|
* Update libstand makefile for zlib 1.2.1.tjr2004-07-011-3/+3
|
* Define iaddr_t and saddr_t for arm.cognet2004-05-141-1/+4
|
* Import _setjmp.S for arm in libstand.cognet2004-05-141-0/+106
|
* No reason to disable this test on powerpc.grehan2004-02-251-2/+0
|
* Use signed char cast to avoid out-of-range error on PowerPC (which hasgrehan2004-02-251-4/+5
| | | | | | unsigned char by default). This is a no-op on all other current arches. Tested by: md5 sum before/after same on i386
* Clean up error handling in libstand filesystem code to be more consistent:jhb2004-01-2110-27/+49
| | | | | | | | | | | | | | | - bzipfs and gzipfs now properly return errno values directly from their read routines rather than returning -1. - missing errno values on error returns for the seek routines on almost all filesystems were added. - fstat() now returns -1 if an error occurs rather than ignoring it. - nfs's readdir() routine now reports valid errno values if an error or EOF occurs rather than EPERM (It was just returning 0 for success and 1 for failure). - nullfs used the wrong semantics for every function besides close() and seek(). Getting it right for close() appears to be an accident at that. - read() for buffered files no longer returns 0 (EOF) if an error occurs, but returns -1 instead.
* - Move the code to try to open a single chunk file and prompt for thejhb2004-01-151-12/+31
| | | | | | | associated floppy if needed into a static split_openfile() function. - Use this function in splitfs_open() to open the first chunk rather than using open() directly. This allows the first chunk to be located on a different disk than the actual foo.split file.
* Whitespace tweaks to make indentation consistent within this file and evenjhb2004-01-151-4/+4
| | | | within a single function.
OpenPOWER on IntegriCloud