Commit Graph

28 Commits

Author SHA1 Message Date
manu 899161bdbc Added vm_copy 2003-06-03 20:09:37 +00:00
manu aa5f0948ad Improved bahvior for map_fd. When Darin uses findspace = 0, this seems to
request a mapping at fixed address, overlaying previously existing mappings.

The overlay is done by unmapping (sys_munmap) before mapping at fixed
location. This makes XDarwin able to link and run.
2003-04-19 21:41:15 +00:00
manu a6757a0de1 Less accurate vm_region, but it sticks better to Darwin results. 2003-03-05 22:39:48 +00:00
manu 03dfd69a01 Added vm_region and vm_msync traps 2003-03-03 22:07:39 +00:00
matt b03d17694a Do a preliminary switchover of the mach code to lwp's. It compiles now
but probably doesn't work.   That's for someone who understand this code
better.
2003-01-21 04:06:06 +00:00
manu f656d621e7 Here we enter the land of IOKit where the shadows lie.
There are two new mach traps:
mach_vm_make_memory_entry, mach_host_get_io_master. Now we need to find
the documentation to understand what they are supposed to do.
2003-01-04 15:15:01 +00:00
manu 4b219b054a I don't know where I saw this 8 bit shift for the inherit argument of
vm_inherit, but it's not usefull (it's even harmful), so remove it.
WindowServer still crashes but later.
2003-01-04 13:17:07 +00:00
manu 5ba396cfb3 Added support for exchange of Mach messages between processes.
This does not buy us new functionnality for now, because we still have to
discover how mach_init (which acts as a name server, enabling processes to
discover each other's ports) is able to receive messages from other processes
(this is a bootstrap problem, and the bootstrap port might be the place to
search).

While we are there:
- removed a lot of debug which is now available using ktrace.
- reworked message handling to avoid mutliple copyin/copyout of the
same data. ktrace of Mach message now uses the in-kernel copy of the
message instead of copying it from userland.
- packed mach trap handlers arguments into a structure to avoid modifying
everything next time we have to add an argument.
2002-12-17 18:42:54 +00:00
manu b8a9df5e21 FIrst attempt at mach ports and rights, which are needed if we ever want
to implement messages between kernel and userland.
While we are there, cleanup some debug messages.
2002-12-15 00:40:24 +00:00
manu 39e39a5b0f Added vm_inherit mach trap. 2002-12-11 21:23:37 +00:00
manu 8d921b897b Added a few traps: port_type, port_set_attributes, port_insert_member,
and vm_protect.

This makes Darwin's /usr/bin/telnet working
2002-12-10 21:36:45 +00:00
manu 6492e2171f Added support for dumping mach messages in ktrace/kdump. While we are
there, KNFify a few functions.
2002-12-09 21:29:20 +00:00
manu db18a73b3d Added vm_wire (unused yet) 2002-12-07 19:06:33 +00:00
manu 56b9df9869 Improved mach_vm_map emulation: take into account proection, alignement,
and improve debug messages.
2002-12-04 22:55:11 +00:00
manu 0f239dc026 Check for alternate receive buffer for mach_msg_overwrite_trap
Check for target buffer length, and fail if it is too short
Move mach_msg_trap and mach_msg_overwrite_trap to their own file
Remove some useless debug messages now we have ktrace
Remove __P()
2002-11-28 21:21:32 +00:00
manu 11aa9ca2f6 Add thread_policy and clock_get_time mach traps. Implement
mach_sys_clock_sleep_trap. This makes sleep(3) emulation working.
2002-11-26 08:10:14 +00:00
manu 5bdd9578e4 Better vm_allocate emulation. 2002-11-24 17:22:59 +00:00
manu 1aaacd96d2 Give a second chance when vm_allocate fail, by finding another free region.
Seems to fix some problems.
2002-11-24 11:49:36 +00:00
manu fe8f53c2a4 in mach_sys_map_fd, if the mapping failed because of the requested place
is already used, we want to remap to another place. The vmcmd must be
completely rebuild, else things does not work as expected, as the vmcmd has
been modified by the first mapping attempt.
2002-11-17 18:39:48 +00:00
manu 55c5227095 Add vm_map and vnode locking 2002-11-17 16:51:12 +00:00
manu a26a564e59 Implment map_fd mach trap
Fix host_info(BASIC_INFO) which was broken wrt to the number of field
returned.
2002-11-16 20:00:29 +00:00
christos b165b2e229 improve on debugging. 2002-11-14 21:17:30 +00:00
manu f130f7a839 In mach_reply_port, don't increment the returned port for now, this confuses
the binary on the second launch.
In mach_vm_map, hack in a failure so that we fail exactly like Darwin when
mapping a page at address 0
Add vm_allocate trap
2002-11-12 06:14:39 +00:00
manu 3eb20e3576 mach_ports_lookup allocate one page of memory and returns its address.
On error, most traps return a short packet with just an error code, emulate
this correctly.
2002-11-12 05:18:31 +00:00
manu d56caea9ae - Cleanup msg bits and trailer values
- a few dumb bug fixes
2002-11-11 09:28:00 +00:00
manu 293d243256 Introduce a better error reporting, using mach error codes
It seems there is no need to use dynamic allocation in mach_host_info.
2002-11-11 01:18:44 +00:00
manu 38455f4db0 The message id of replies is simply the message id of the request plus 100... 2002-11-10 22:05:35 +00:00
manu 556831bae9 More mach traps:
mach_port_deallocate, task_get_special_port, mach_ports_lookup,
vm_deallocate, vm_map, host_get_clock_service.
2002-11-10 21:53:40 +00:00