Commit Graph

68 Commits

Author SHA1 Message Date
christos b2163312f5 fix unused variable warning 2003-07-11 18:55:14 +00:00
manu 90c0f71598 Add HW_MACHINE sysctl 2003-07-10 14:47:34 +00:00
manu 0229e10bf3 Added a IOFBSETCOLORCONVERTTABLE method in ioframebuffer driver.
Added sanity check for user provided offsets in messages.
2003-07-01 19:15:47 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
darrenr 960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
martin d505b18964 Make sure to include opt_foo.h if a defflag option FOO is used. 2003-06-23 11:00:59 +00:00
manu 278cce5ba7 regen 2003-06-05 12:28:01 +00:00
manu 2c3b365958 Search alternate /emul/* path for AF_LOCAL sockets at bind() time. 2003-06-05 12:26:27 +00:00
manu faba943220 Added IOHIDSystem properties (this is about keyboard mapping)
Also added a ssize arg to mach trap args so that trap handler are aware
of the sent packet size.
2003-06-03 06:48:47 +00:00
manu 1ea26aeafe + In ioframebuffer driver:
We try to map the console framebuffer through wsdisplay. It seems to work,
 but we still need to _see_ something.
XXX Framebuffer size discovery is borken.

+ In ioframebuffer and iohidsystem:
More methods and more debug for io_connect_method_*

+ A few new IOKit mach traps.
2003-05-22 22:07:36 +00:00
manu 1ab318ff2d We had ugly magic values in io_connect_method_scalari_scalaro and friends.
Peeking at Darwin's header files gives some ideas of what we are doing here.

We know understand most of the stuff called by XDarwin and WindowServer before
mapping the framebuffer.
2003-05-15 23:35:37 +00:00
manu da05e7b4d3 Added io_service_close and the io_connect_map_memory method for
ioframebuffer's shared meory (used to handle the cursor).

XDarwin and WindowServer now fail on framebuffer mapping.
2003-05-14 18:28:04 +00:00
manu f75cb60078 One more I/O flavor for the ioframebuffer driver. XDarwin now crashes
when it comes to map the cursor shared memory (accroding to the source,
next step will be mapping the framebuffer, we are getting closer)
2003-05-14 15:50:38 +00:00
manu 31b52bb7f2 More efforts on the XDarwin front. Introduce io_connect_method_scalari_structo
and io_connect_method_structi_structo. We don't know at all how this stuff
works, but at least we can imitate what Darwin does.
2003-05-14 14:41:04 +00:00
manu 962a6c7d59 Fix a bug in io_registry_entry_get_property: one of the field in the
return packet was wrong (port descriptor instead of VM area descriptor),
thus leading to SIGSEGV when calling IOKit's IOFBCreateSharedCursor().

Now this is fixed we can move forward again on graphic mode.
2003-05-13 20:48:16 +00:00
manu d46d73437c Added the map_memory method for the IOKit, plus an implementation
for the IOHIDSystem driver in Darwin. IOHIDSystem provides access
to user interface devices.

Communication between userspace and kernel is done through a shared
memory page. Our plan is to have a kernel thread waiting on wscons
events (for now it just does nothing), and have it feeding the
shared page.
2003-04-29 22:16:38 +00:00
manu cbfe387fcc swapped the words in lseek offset reassembly (that was was confused-endian)
Removed useless include that came from a copy/paste.
2003-04-20 14:36:05 +00:00
christos 962f5ffade try to get this to work for both endian machines. 2003-04-20 00:32:16 +00:00
manu 1368d826d9 Regen 2003-04-20 00:10:20 +00:00
manu beca0eff14 Fixed an ABI bug in lseek: NetBSD pads the syscallarg structure because of
the off_t argument, Darwin does not. In order to get the off_t  argument
going through our syscall machinery, we declare it as two long arguments,
and we reassemble it in darwin_sys_lseek.
2003-04-20 00:09:41 +00:00
manu 523dbf2146 Quick and dirty version of io_registry_entry_get_properties. 2003-03-09 18:33:28 +00:00
manu c3be74fe41 Introduced IOKit driver methods. Moved back into Mach some IOKit driver
support that was in Darwin code. I get an empty darwin_iokit.c, which is
getting a good candidate for cvs delete.
2003-02-20 22:39:42 +00:00
manu ca120fe1a2 Match IOHIDSystem and IOFramebuffer request in the IOKit and handle them in
Darwin specific files. The handler does nothing yet.

This needs some improvement. Darwin attaches an IOHIDSystem device to
each human-interface device in the tree: mouse, keyboard, and a few others.
For now we only emulate one IOHIDSystem device.
2003-02-16 15:02:05 +00:00
manu a643d6a63e Fixed typo 2003-02-03 20:46:55 +00:00
manu cb771e3c64 Make the beast build again (but it is still probably broken) 2003-01-24 21:37:01 +00:00
christos ed339f5241 regen. 2003-01-22 17:47:47 +00:00
christos bcc3424bc3 regen 2003-01-22 17:47:35 +00:00
christos 498aa03f2a lwp conversion 2003-01-22 17:47:03 +00:00
thorpej a03cb2b851 Regen to get correct RCS ID. 2003-01-18 23:28:15 +00:00
manu 7f468ee029 Bug fixes for the fake pid hack.
WindowServer is now able to talk with mach_init to exchange bootstrap
information.
2003-01-03 14:47:27 +00:00
manu 80d406d8fe FIxed the way rights are recycled: the refcount makes only sense for
send, send once, and dead names, not for port sets and receive rights.
This make vi and telnet able to work again.

Also removed the all process right list and its lock, which got useless. The
all process lock is replaced by a per process lock, located in struct
mach_emuldata.

Also one bug fix: we did not correctly called Mach hooks for struct emuldata
initialization and release for Darwin processes.
2003-01-03 13:40:04 +00:00
manu f3e11e72e9 Introduce port names, deallocate mach ressources at Darwin process exit 2002-12-31 15:47:37 +00:00
manu d9f2a8dbcd - When mach_init saves the bootstrap port, make it the default bootstrap port
for any program we will launch later. This is a hack to avoid the need
of launching any Darwin binary as a child of mach_init
- More and more debug
2002-12-30 18:44:33 +00:00
manu 459d0be3a4 More hacks to make Darwin's /sbin/init happy with its pid. 2002-12-28 00:15:23 +00:00
manu 3b815ab820 We must also return pid 2 when mach_init asks for its pid after it forked init. 2002-12-27 19:54:54 +00:00
manu f464631d66 Several things:
1) rights should be shared by the threads within a process. While it would
be easier to handle this with the struct proc/struct lwp split, we attempt to
do this now by sharing the right lists. Because each right holds a reference
to struct proc, this might cause some problems later.
2) in pthread_exit, really exit the thread. Also reintialize the righ tlist to
make sure we will not destroy the parent's right list
3) rights can hold multiple permissions on a port (ie: send and receive). Fix th
is.
4) first attempt on right carried by messages. We still have to do rights carrie
d in the message body (complex messages).
2002-12-27 09:59:24 +00:00
manu 20fca78f89 regen 2002-12-26 14:41:34 +00:00
manu bab8693bba Added the mysterious system call 331 (it does not seems to be in the
header files anywhere). This is pthread_exit.
2002-12-26 14:41:05 +00:00
manu 41bfbd28fe On Darwin, mach_init is the system bootstrap process. It is responsible
for forking the traditional UNIX init(8) and it does the Mach port naming
service. We need mach_init for the naming service, but unfortunately, it
will only act as such if its PID is 1. We introduce a sysctl
(emul.darwin.init_pid) to fool a given process into thinking its PID is 1.
That way we can get mach_init into behaving as the name server.

Typical use:
/sbin/sysctl -w emul.darwin.init_pid=$$ ; exec /emul/darwin/sbin/mach_init
2002-12-24 12:15:45 +00:00
manu c075c4d7f5 Get less debug output 2002-12-24 12:13:15 +00:00
manu 4386631757 regen 2002-12-08 21:53:57 +00:00
manu 9f6565f2bd A working fork/vfork implementation. Darwin fork differs from our fork by
two ways:
- the child gets its pid as retval[0] (userland stub will turn it into a 0),
retval[1] is 1 and it is 0 in the parent.
- in the child, the fork syscall is successful, hence we must skip the next
instruction.
2002-12-08 21:53:10 +00:00
manu daccb0339c regen 2002-12-08 00:51:24 +00:00
manu 3b0f6d78ed Introduce BSD system calls with alternate patch checking (in /emul) in
compat/common, so that they can be shared by several emulations, and use
them for Darwin.

This removes the ugly dependance on FreeBSD freebsd_file.c for COMPAT_DARWIN
2002-12-08 00:50:23 +00:00
manu 9b84721494 Added implementation for cthread_self() and cthread_set_self(). Theses are
used to get and set the thread user value, which is an opaque pointer to
a per thread structure stored in userland. cthread_self() is used by Darwin
as an implementation for pthread_self(), which return the thread id.

We use the p_emuldata field of struct proc in order to keep track of the
thread user value. For now the value is per-process, but we will make it
per-thread when we will take care of threading.

While we are there, do some KNF
2002-12-07 15:33:01 +00:00
manu f0332ec923 In load_shared_file, do zero-fill uninitialized data segments that
explicitely request to be zero filled.
2002-12-05 22:48:53 +00:00
manu f47b85037b Added a few kern sysctl which are the same on Darwin and NetBSD. 2002-11-29 13:18:09 +00:00
manu 65adabf7aa Filter the flag bits we get from Darwin's sigaction when giving them to
our native sigaction beacause unknown bits cause sigaction to fail with EINVAL.
2002-11-29 13:17:22 +00:00
manu de5d0b9706 Remove __P 2002-11-28 21:23:54 +00:00
atatat 7caa308c63 Complete the rename: s/sa_/<compat>_sa_/g
Also tweak the darwin siginfo stuff to avoid the same type of collision.
2002-11-27 16:44:01 +00:00