summaryrefslogtreecommitdiffstats
path: root/sys/kern/imgact_gzip.c
Commit message (Collapse)AuthorAgeFilesLines
* Use the fields in the sysentvec and in the vm map header in place of thejake2002-09-211-1/+1
| | | | | | | | constants VM_MIN_ADDRESS, VM_MAXUSER_ADDRESS, USRSTACK and PS_STRINGS. This is mainly so that they can be variable even for the native abi, based on different machine types. Get stack protections from the sysentvec too. This makes it trivial to map the stack non-executable for certain abis, on machines that support it.
* Infrastructure tweaks to allow having both an Elf32 and an Elf64 executablepeter2002-07-201-1/+1
| | | | | | | | | | | | | | | handler in the kernel at the same time. Also, allow for the exec_new_vmspace() code to build a different sized vmspace depending on the executable environment. This is a big help for execing i386 binaries on ia64. The ELF exec code grows the ability to map partial pages when there is a page size difference, eg: emulating 4K pages on 8K or 16K hardware pages. Flesh out the i386 emulation support for ia64. At this point, the only binary that I know of that fails is cvsup, because the cvsup runtime tries to execute code in pages not marked executable. Obtained from: dfr (mostly, many tweaks from me).
* Modernize my email address.phk2002-03-251-1/+1
|
* Remove __P.alfred2002-03-191-4/+4
|
* Make MAXTSIZ, DFLDSIZ, MAXDSIZ, DFLSSIZ, MAXSSIZ, SGROWSIZ loaderps2001-10-101-1/+1
| | | | | | | tunable. Reviewed by: peter MFC after: 2 weeks
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-011-1/+2
| | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations)
* Fix a typo.jhb2001-01-241-1/+1
| | | | Reported by: albert
* Proc locking.jhb2001-01-241-0/+1
|
* useracc() the prequel:phk1999-10-291-1/+0
| | | | | | | | | | | Merge the contents (less some trivial bordering the silly comments) of <vm/vm_prot.h> and <vm/vm_inherit.h> into <vm/vm.h>. This puts the #defines for the vm_inherit_t and vm_prot_t types next to their typedefs. This paves the road for the commit to follow shortly: change useracc() to use VM_PROT_{READ|WRITE} rather than B_{READ|WRITE} as argument.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Correctly return ENOEXEC for really short zipped files. The way this ishoek1999-06-211-1/+10
| | | | | | | | done is less-than cute, but this whole file is suffering from some amount of bitrot. Execution of zipped files should probably be implemented in a manner similar to that of #!/interpreted files. PR: kern/10780
* Fix a couple of warnings and some bitrot in comments.peter1999-05-091-4/+1
|
* *_execsw static structures cannot be const due to the way they interactdillon1999-01-291-2/+2
| | | | | | with EXEC_SET, DECLARE_MODULE, and module_register. Specifically, module_register. We may eventually be able to make these const, but not now.
* *gulp*. Jordan specifically OK'ed this..peter1998-10-161-2/+2
| | | | | | | | This is the bulk of the support for doing kld modules. Two linker_sets were replaced by SYSINIT()'s. VFS's and exec handlers are self registered. kld is now a superset of lkm. I have converted most of them, they will follow as a seperate commit as samples. This all still works as a static a.out kernel using LKM's.
* Cast u_longs to uintptr_t before casting them to pointers. Don'tbde1998-07-151-6/+7
| | | | | attempt to even partially support systems with function pointers larger than object pointers.
* Use copyout() instead of bcopy() to copy the image to user space.bde1998-06-161-5/+7
| | | | | | | | | bcopy() caused panics under heavy paging (not quite as suspected - the kernel stack seemed to get corrupted). Fixed long lines. Reviewed by: phk
* Make gzipped dynamically linked executables work again. There wasjdp1997-12-141-4/+4
| | | | | | an old bug here that failed to copy the a.out header into memory properly. It didn't matter until changes were made recently to the dynamic linker.
* Removed unused #includes.bde1997-09-021-3/+1
|
* Removed redundant test against MAXDSIZ (the rlimit test is stronger).bde1997-08-261-4/+1
|
* Fully implement vfork. Vfork is now much much faster than even ourdyson1997-04-131-2/+4
| | | | | | | | | | | | | | | | | fork. (On my machine, fork is about 240usecs, vfork is 78usecs.) Implement rfork(!RFPROC !RFMEM), which allows a thread to divorce its memory from the other threads of a group. Implement rfork(!RFPROC RFCFDG), which closes all file descriptors, eliminating possible existing shares with other threads/processes. Implement rfork(!RFPROC RFFDG), which divorces the file descriptors for a thread from the rest of the group. Fix the case where a thread does an exec. It is almost nonsense for a thread to modify the other threads address space by an exec, so we now automatically divorce the address space before modifying it.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* This is the kernel Lite/2 commit. There are some requisite userlanddyson1997-02-101-1/+1
| | | | | | | | | | | | | | | changes, so don't expect to be able to run the kernel as-is (very well) without the appropriate Lite/2 userland changes. The system boots and can mount UFS filesystems. Untested: ext2fs, msdosfs, NFS Known problems: Incorrect Berkeley ID strings in some files. Mount_std mounts will not work until the getfsent library routine is changed. Reviewed by: various people Submitted by: Jeffery Hsu <hsu@freebsd.org>
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Make DFLDSIZ and MAXDSIZ fully-supported options.joerg1996-12-221-1/+3
| | | | "Don't forget to do a ``make depend''" :-)
* Fixed the easy cases of const poisoning in the kernel. Cosmetic.bde1996-08-311-2/+2
|
* Write protect the text segment of gzip'ed programs.phk1996-08-011-27/+21
| | | | | | | Various other cleanups by phk. Reviewed by: phk Submitted by: Igor Khasilev <igor@jabber.paco.odessa.ua>
* First pass at cleaning up macros relating to pages, clusters and all that.phk1996-05-021-7/+6
|
* Removed unnecessary #includes from <sys/imgact.h> so that it isbde1996-05-011-1/+3
| | | | self-sufficient and added explicit #includes where required.
* Fixed unsigned longs that should have been vm_offset_t.bde1996-03-191-2/+2
| | | | | | | | | | vm_offset_t is currently unsigned long but should probably be plain unsigned for i386's to match the choice of minimal types to represent for fixed-width types in Lite2. Anyway, it shouldn't be assumed to be unsigned long. I only fixed the type mismatches that were detected when I changed vm_offset_t to unsigned. Only pointer type mismatches were detected.
* rewrap some long lines.phk1996-02-131-6/+8
|
* Eliminated many redundant vm_map_lookup operations for vm_mmap.dyson1996-01-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Speed up for vfs_bio -- addition of a routine bqrelse to greatly diminish overhead for merged cache. Efficiency improvement for vfs_cluster. It used to do alot of redundant calls to cluster_rbuild. Correct the ordering for vrele of .text and release of credentials. Use the selective tlb update for 486/586/P6. Numerous fixes to the size of objects allocated for files. Additionally, fixes in the various pagers. Fixes for proper positioning of vnode_pager_setsize in msdosfs and ext2fs. Fixes in the swap pager for exhausted resources. The pageout code will not as readily thrash. Change the page queue flags (PG_ACTIVE, PG_INACTIVE, PG_FREE, PG_CACHE) into page queue indices (PQ_ACTIVE, PQ_INACTIVE, PQ_FREE, PQ_CACHE), thereby improving efficiency of several routines. Eliminate even more unnecessary vm_page_protect operations. Significantly speed up process forks. Make vm_object_page_clean more efficient, thereby eliminating the pause that happens every 30seconds. Make sequential clustered writes B_ASYNC instead of B_DELWRI even in the case of filesystems mounted async. Fix a panic with busy pages when write clustering is done for non-VMIO buffers.
* Untangled the vm.h include file spaghetti.dg1995-12-071-1/+7
|
* Staticized.bde1995-12-021-2/+3
| | | | Added prototypes.
* All:dg1995-11-061-6/+6
| | | | | | | | | | | | Changed vnodep -> vp for consistency with the rest of the kernel, and changed iparams -> imgp for brevity. kern_exec.c: Explicitly initialized some additional parts of the image_params struct to avoid bzeroing it. Rewrote the set-id code to reduce the number of logical tests. The rewrite exposed a mostly benign bug in the algorithm: traced set-id images would get ktracing disabled even if the set-id didn't happen for other reasons.
* Remove trailing whitespace.rgrimes1995-05-301-2/+2
|
* Add and move declarations to fix all of the warnings from `gcc -Wimplicit'bde1995-03-161-3/+1
| | | | | | (except in netccitt, netiso and netns) and most of the warnings from `gcc -Wnested-externs'. Fix all the bugs found. There were no serious ones.
* Use of vm_allocate() and vm_deallocate() has been deprecated.dg1995-02-201-15/+17
|
* Actually access the right first page if the file.phk1995-02-131-2/+2
| | | | | | | Bruce finally caught this bogon for me, Thank you Bruce ! Due to some part of the VM/buffer/pmap magic doing clustering, this bogon managed to work better than 99.9% of the time. Amazing. If You ever again see a weird message from the gzip code, please tell me.
* Make the diagnostics a little more useful.phk1994-10-221-2/+3
| | | | | | | | | | | | | | | | | | | | A word of wisdom, don't do this: | cd /usr/bin | for i in * | do | cp $i /tmp/a | gzip -9 < /tmp/a > $i | done It will compress files with multiple links several times. do it this way: | cd /usr/bin | for i in * | do | gunzip -f < $i > /tmp/a | gzip -9 < /tmp/a > $i | done
* I belive imgact_gzip is finally reentrant. It is also a whole lot morephk1994-10-221-217/+298
| | | | | | | readable. inflate is now much more general, and is there if anybody feels like making a uncompressing filesystem or something like that (hint hint !)
* - remove unnecessary #includes (I think a couple of redundant ones remain)csgr1994-10-111-7/+9
| | | | | | | | - excise some unused code (#if 0'd out - don't want to nuke it yet) - fix problems with "make depend" - some macros were screwing it up - get rid of some static local variables There still seems to be a small reentrancy problem somewhere.
* First stage of getting imgact_gzip reentrant:csgr1994-10-071-1211/+9
| | | | | | | | | | | | | | | | | | | | | 1) cut this up into /sys/sys/inflate.h, sys/kern/inflate.c sys/kern/ingact_gzip.c 2) make a lot more things static 3) make a lot of globals const 4) make some args const 5) first stage of making globals into a struct (not used yet) The vm_allocate() call which was introduced between revisions 1.4 and 1.5 of imagact_gzip.c broke things. I have backed that out for the time being. (Davidg: help please) WARNING: if you have gzip enabled in your kernel, you must now run config again, as another source file has been added. Otherwise your kernel compile will fall over. This is all still WIP. More commits to come. Suggestions from: phk.
* Steven Wallace provided a program which broke this stuff. I guess there arephk1994-10-061-1/+8
| | | | | | | more weird kinds of a.out than anyone can argue for. This code failed to load the first 28K of the text-segment, in the case where the first page of the a.out contains only the a.out-header, and the text is still at 0x0. Thanks Steven !
* David Greenman told me to do this: (Thanks!) use vm_allocate to allocatephk1994-10-051-5/+5
| | | | | | the uncompression buffer. Now malloc(M_GZIP) is used for all the Huffman- tree stuff only. Numbers so far indicate < 15Kb Malloc use + 32 Kb for the abovementioned buffer while uncompressing.
* Added M_GZIP for the imgact_gzip code. The gzip-code is likely to be usedphk1994-10-041-6/+13
| | | | for other weird things in the future (hint, hint!)
* Based on the applause (in this case: not downright rejection :-) I havephk1994-10-041-53/+67
| | | | | | | | | | | | | | | | | cleaned up much of the cruft in this thing. No printf's in the case where things go well. Gzip-headers can contain filenames and comments (as long as they're shorter than the page-size.) I don't think we leak memory, in the "exec/aout" code. I'm not quite sure about the inflate code yet, but I don't think memory is lost. Q: Can I add a class M_GZIP to <sys/malloc.h> and bump M_LAST one up without any thing else needing tweaking ? Poul-Henning
* First bug-fix. This this depends on something odd. I am looking at it,phk1994-10-031-3/+9
| | | | but every now and then it will fail without an explanation :-(
* ***phk1994-10-031-0/+1456
WARNING: THIS MATERIAL MIGHT GO AWAY! This material needs the core-groups approval to stay here for the 2.0 release. If the core-group does not concent to this commit, it will be backed out. *** It is a non-gpl'ed "unzip" which will allow execution of a.out files which have been sent through "gzip -9". The idea being saved disk-space. Just now this code has quality rating: "working prototype". To compress a file to be used with this, do it exactly this way: gzip -9 -v < /bin/FOO > /tmp/FOO remember to chmod /tmp/FOO as needed. DON'T compress all of you binaries right away ! There are several things which you should consider first: 1. Using compressed binaries, you use >MUCH< more VM, and thus swap-space. 2. It is slow. 3. It might crash your machine. Apart from that, I welcome comments... NB: There is also a change to sys/conf/files, but cvs core-dumped on me, so it didn't get into the logs or emailed, but the commit seems to have happended OK.
OpenPOWER on IntegriCloud