add linux_emul base, reorganize docs
[openbsd_emul.git] / linux_emul_base / CHANGES
CommitLineData
cae36a52 12008-08-16
2Creation of a CHANGES file
3
4A entry starts with the date followed by a newline and then
5the content follows. Usualy, the first line after the date
6is some short description and then a loger follows.
7To terminate the entry, intert two newlines at the end.
8
9So this entry serves as an exampe. Hope this is simple enougth :-)
10
11
122008-08-16
13New debugging implemented
14
15Debug code removed from mem.c and trap.c and rewrote in
16acid. See the DEBUGGING section in the HOWTO file for further
17information.
18
19
202008-08-17
21Fontconfig crash fixed, Debug code fixes
22
23libfontconfig mapped some config files with len == 0, this
24was not handled correctly so it crashed.
25
26the umem() acid function didnt check for zero segment
27pointers so it showd invalid data for the mostly unused
28SEGSHARED segment.
29
30
312008-08-18
32Some minjor fixes
33
34more checking in memory manager
35sys_[gs]etpgrp implemented for pid != current->pid
36renamed emu.c to main.c
37set UID/GID/EUID/EGID in AUXVEC on exec()
38
39
40
412008-08-21
42Making prof(1) work (at least dont let it crash)
43
44mem.c: convertseg():
45
46Peplaced read() calls to pread() to prevent profiling related crash.
47The problem was that convertseg() detaches the DATA segment reattaches
48a new one and used read() to get the contents back. read() was a
49profiled function and the profiler finds its structures cleared to
50zero and crashes. We now use pread() that is a unprofiled assembly
51syscall stub.
52
53Still, child processes and kprocs are not currently profiled.
54
55
562008-08-22
57AF_UNIX client sockets implemented
58
59Its a little bit of a hack. We do the AF_UNIX handling like APE
60does so we can interact with the ported Xservers Xbr and equis.
61
62
632008-08-23
64Work arround for mozilla GPFAULT bug
65
66If a process is notified that he has pending signals with the
67"sig" message and if the note interrupts the execution of a
68INT 0x80 instruction, a syscall in the handler causes mystic
69crashes i dont understand.
70
71The work arround detects the condition and delays the
72handling of the signals returning back to userspace.
73
74I could reproduce the condition and this hack seems
75to work. I should write some testcase to analyze this
76condition further. Maybe its some kernel bug.
77
78
792008-08-23
80Minjor file related fixes/cleanups
81
82- Implemented in miscdev.c for writable /dev/zero
83- sys_umask() now returns the previous umask
84- default umask set to 022
85- sys_umask() sys_cwd() moved from proc.c to file.c
86
87
882008-08-24
89linuxemu.rc script updated
90
91- resolve relative rootpath
92- generate /etc files for hostname and resolv.conf if not readable
93- removed enviroment user->USER home->HOME conversion in main.c
94
95
962008-09-10
97Better work arround for mozilla GPFAULT bug
98
99The problem arises because of the handling of notes in Plan9 kernel.
100
101It happens if linux code does a syscall while here are usernotes (like
102the "sig" ones) queued in the process note[] array. Then the trap()
103function in the kernel will enqueue the trap in the queue and the user
104note gets handled first.
105
106Now, after we have done a syscall in the note handler of the user
107signal, notify() gets called in the kernel that detects the next note
108to be a trap and thinks the note handler itself caused it and kills
109the process.
110
111I suggested a patch that makes sure traps get enqued on the head of
112the note[] array so that they get handled before a user note but its
113not decided to be applied yet so here is the work arround.
114
115The work arround avoids posting notes to a process that could possibly
116cause a trap in the future before the usernote gets handled. (this
117excluded all linux code because it can issure a syscall anytime) The
118only time it is save to post notes is if we are in linuxemu syscall
119handler.
120
121This is mostly the case anyway when notes are used to interrupt
122blocking syscalls (waking a process sleeping in a sigsuspend for
123example)
124
125Linuxcode that would spin in a endless loop will not be interrupted by
126notes/signals anymore.
127
128
1292008-09-20
130Minjor stuff
131
132Masking more fp-errors in trap.c. (To get some dos game running in
133bochs)
134
135prboom and zsnes was bumpy sometimes because our select() didnt set
136the struct timeval *tvp to the time the select call did not slept.
137
138I stat function pointer was removed from the Ufile struct and all the *dev.c
139files. I have no need to return custom stats from the devices right now
140(except for /dev/zero (mode & 0222)) so i move the only case where its
141needed into the hackish dir2statmode function in p9dev.c. Here is also
142an fd field added to the generic Ufile scruct because most of all devices
143use plan9 filedescriptors at some point and we use it in fstat(). Saves some
144casting and fstat can use the fd (when its available) to make a dirstat() and
145convert to linux format.
146
147For the postnote stuff mentiond in the last changes entry, here is a global
148flag in main.c (notehack = 1) to enable/disable the work arround.
149
150
1512008-09-21
152atime/mtime, AT_CLKTCK
153
154new syscalls
155- sys_utime
156- sys_utimes
157- sys_times
158
159the AT_CLKTCK entry in exec is set to _tos->cyclefreq
160now.
161
162
1632008-10-05
164faster death proc detection
165
166Using linuxemu from terminal caused huge network load
167because we did a lookup of /proc/# on every timer round.
168
169now we keep open filedescriptors for /proc/#/args and
170/proc/#/note in the proc structure and only check for
171dead procs every second.
172
173
1742008-10-05
175sound (/dev/dsp)
176
177OSS sound implemented, its only tested with some SDL
178apps (zsnes, prboom).
179
180The output frequency is hardcoded at 44100 Hz and 2
181channels stereo at the moment.
182
183
1842008-10-20
185dsp, stat, mkfile, -d, dns, fs
186
187dspdev detects output frequency now and implement more
188ioctls.
189
190here is an universal Ustat and Udirent structs to separate
191the linux formats from driver code.
192
193big chnage in all devices, added indirection layer fs.c that
194has some kind of mapping from path -> device and forwards
195filesystem calls to device drivers. now drivers can return
196correct stat information.
197
198this is needed for implementing /dev/pts later.
199
200removed the /etc/(hosts resolve.conf) generation code from
201linuxemu.rc because they dont work in some cases and
202cause maintence nightmares.
203
204use the -d switch for turning on trace to stderr. so we dont
205need to always change the if(0) from trace.c and recompile.
206
207force compiler flags in mkfile, the -T from new mkone breaks
208build on current distribution.
209
210
2112008-10-27
212lots of fixes
213
214- off by one error basepath()
215- chmod used access which resolves always to link target
216- runlink
217- the note hack broke sigprocmask, and sometimes failed
218 to interrupt a sleepproc(). this is now handled in
219 interruptproc(). (this makes drawterm work on linuxemu)
220- write() to pty was not synchronized/not blocking that
221 caused some apps to spin in write() or others to drop
222 characters (curses).
223
224
2252008-10-28
226grow filedescriptor table in dup2
227
228- if the new fd supplied is out if range, dont return error but
229 grow the fdtab so it fits in. (this make configure work)
230
2312008-11-15
232lots of changes
233
234- Updated HOWTO
235
236- included <ureg.h> in some modules. this fixed the type
237 signature errors of 8l when compiling with -T flag.
238
239- fixed bug in exec()
240 exec needs to run outside the the note context, because it
241 is deleting memory segments and that can cause the removal
242 of the stack segment as well. we have to set current->syscall
243 to nil to avoid getting a note posted that could interrupt us in
244 the middle of some malloc() or something.
245
246- sys_pipe() FD_CLOEXEC
247 sys_pipe() create the filedescriptors with FD_CLOEXEC bit
248 set as open() does. this is wrong and caused gimp plugins
249 to fail.
250
251- new signal handling code
252 signal.c has changed a bit. now CLONE_THREAD procs
253 share a signal queue and proc() uses wantsignal() to
254 figure out what process to interrupt.
255
256- restartable syscalls
257 re process SA_RESTART flag now and are able to restart syscalls
258 that got interrupted by such signals. sleepproc() returns -ERESTART
259 by default now. sys_poll() and sys_sleep() will return -EINTR in
260 any case.
261
262- fs reorganized, [sg]etxattr added, p9cwd added as an optimization
263 to avoid walks().
264
265- ptydev emits SIGINTR to process group, added tty to Uproc.
266
267- added fddev (/dev/fd)
268
269- exitproc() now emits SIGCHLD.
270
271- mem.c: addrok() now takes a prot flags parameter so we can test
272 for expected memory protection too.
273
274- profme(): profiling support for child processes added
275
276- initialization completly moved in main()
277
278- fchmod, fchown, ftruncate moved to file.c
279
280
2812008-10-19
282just code dressing...
283
284renamed some files, added typedef for Ureg, abstracted syscall specific
285code in linuxcall.c, more tracing...
286
287
2882009-02-06
289Fixed the opera fork() no more threads bug
290
291There was a problem of dns resolver zombie processes created by
292operseemed that used up all the process table due to incomplete
293implementation of clone(). Linux specified a exit signal in the lower
294byte of the clone- flags parameter to tell if the process should hang
295arround as zombie so that the parent can wait for it. If no signal is
296specified here, then the process should exit without becoming a
297zombie. Here is also the case that the parent ignores the SIGCHLD
298signal or has SA_NOCHLDWAIT flags on the SIGCHLD set. In that case
299the child should also purge itself. I implemented reparenting,
300because i suspected the bug there but this was not the case.
301
302Here is a new uprocs() acid function that dumps the proctab.
303
304
3052009-02-18
306Minjor changes
307
308Added anonymous area merging to reduce the area count and removed
309redundant clearmem calls. Changed Uwaitq lock from QLock to normal
310spinlock. Removed some trace() calls.
311
312The biggest change is that linuxemu.rc now is able to start equis. This
313simplyfies writing wrapper scripts to start a browser or other X11 apps.
314
315
3162009-03-25
317Simplyfied area merging in memory manager
318
319Areas are doubly linked now so its easier to get the previous area for
320mergearea().
321
322
3232009-03-30
324Fixed man-bug. (Restarting syscalls)
325
326Restarting syscalls failed if the singal that was send to the interrupted
327process was blocked. This is fixed now.
328
329
3302009-04-01
331fixed awd-bug (use builtin cd), make errors more verbose in exec.c
332
333bla
334
3352009-05-11
336fix pipeseek, added pread64, pwrite64 syscalls.
337
338forgot to return -ESPIPE on seekpipe.
339implemented pread64/pwrite64 (needed by git).
340
341
3422009-07-25
343random stuff
344
345- incred bufproc read and queuesize to 4K/64K (fixes links2 -g hang)
346- reuse buffers in bufproc
347- cleanup timer stuff, introduce 5ms min sleep time, avoid interrupt note
348- fix sys_select() to always modify tv
349- fix format mismatch in nextsignal
350- dont combine in sys_readv/sys_writev
351- fix open in devdsp.c
352- s/memcpy/memmove/g
353- dont reset segment registers for signal handlers
354- possibly more that i forgot... use history(1)
355
356
3572009-07-27
358fixed audio delay
359
360keeping track of how many samples (time) has been submitted
361to /dev/audio already and wait when the buffer grows over some
362treshold. this removes the audio delay from games :)
363
364
3652009-07-29
366doc
367
368put documentation in doc subdirectory.
369
370
3712009-07-31
372mremap, segbrk shrinking, pagesize, doc
373
374rewrote mremap implementation to correctly clear area for shrinking.
375handles more error cases and checks for overlap. this fixes the gimp
376invalid pointer bug.
377
378removed segment shrinking with segbrk as this feature may be removed
379in newer kernel versions as it introduced a bug where it is possible to
380unmap pages while the kernel touches them and cause a panic.
381
382removed the ROUNDPAGE() macro from dat.h. heres a pagealign()
383function in mem.c now and the global variable pagesize that is initialized
384in main.
385
386some documentation cleanups.
387
388
3892009-08-24
390dspdev improvements.
391
392do some linear interpolation in audio resampling to get better sound quality.
393avoid copy when no resampling is required. reflect queue full in
394GETOSPACE ioctl. cleanup code to avoid vlong calculations.
395
396
3972009-08-26
398bugs
399
400fixed uninitialized values in stat wich caused -EOVERFLOW on linux
401kernel build. removed wakeableproc() (changes in signal.c, ptydev.c,
402bufproc.c, poll.c). fixed sigsuspend race. simpler waitq code (uses
403lesser memory too). fixed waitpid race. added /dev/dsp0 to dspdev
404(makes mikmod work). fixed rfork/notify crash.
405
406
4072009-08-30
408mplayer, bb, audacity play cursor, bugs
409
410refactored timers, alarm and deadproccheck into one timerproc and
411removed timer.c. every Uproc has a timeout field now that is the
412time in nanoseconds when the timeout expires. on expiration, the
413timerproc sets the value to zero and does a wakeup on the
414timed out process. a process sets/resets its timeout with
415settimeout(delta). the remaining time in ms can be queried with
416timeoutremain().
417
418fixed missing protection flags in setupstack.
419
420more acurate GETOSPACE (mplayer, bb) and new GETOPTR
421ioctl (needed for audacity play cursor) in dspdev.c.
422
423handle kill note as SIGKILL in trap.c.
424
425handle illegal instruction as SIGILL as pass/restore sigcontext
426(needed for mplayer runtime SSE check).
427
428sys_sigreturn now uses current->ureg->sp to find the restore
429information.
430
431preallocate all Uprocs.
432
433
4342009-09-06
435cleanup
436
437removed dev argument from fdgetfile()
438
439return correct -ENOSOCK in socketcall()
440
441fixed pread/pwrite, dev->read/dev-write now take a offset
442argument.
443
444fixed time diff overflow in dspdev
445
446
4472009-09-08
448fuckup, O_TRUNC, restaring syscalls, rc, getdents
449
450fucked up:
451- seek didnt work for whence == 1 as the plan9 seek pointer was
452 never moved in read due to change to pread. this caused cp to
453 corrupt the output file when it skipped null blocks.
454- basepath in fs.c was broken
455- readv/writev didnt increment the file offset
456
457what we have now is that file.c does all the offset tracking, and
458devices provide a size() function that returns the actual file size.
459
460added O_TRUNC for open.
461
462signal restarting sometimes resulted in returning -ERESTART to
463userspace. this could happen when another thread had stolen
464our signal. we now restart the syscall in nextsignal() even if
465here was no signal pending for us.
466
467removed the exitsig function from linuxemu.rc as we can use
468the -terminate option of the xserver to get it shutdown.
469
470read the whole directory, then calculate file offset for directory
471entries.
472
473
4742009-09-12
475signal handling changes, acid, rc
476
477
4782009-09-20
479sockets, basepath, alarm
480
481fixed error in basepath (*ps vs ps) and implemented nonblocking connect,
482server sockets, socketpair, sys_alarm
483
484
4852009-10-13
486lots of changes
487
488simplified locking by making process wakeup non blocking.
489to not miss wakeups, the to be suspended proc should call wakeme(1)
490before it goes to sleep.
491
492timers for alarm/itimer have been moved to the per "process" signal
493data. current->timeout is still local to the current "thread".
494
495sys_kill() now makes sure we only send one signal per "process".
496
497syscall restarting now can use the Urestart (current->restart)
498structure to remember state. (implemented for nanosleep, poll and
499select)
500
501changed default to non tracing.
502
503pty now handles winsize changes. fixing current tty changing. (ssh bug,
504rxvt bug)
505
506added /dev/random and /dev/urandom to miscdev.
507
508more ioctls for dspdev.
509
510enforce non reentancy for traps.
511
512
5132009-10-15
514fixed sys_brk()
515
516we now use a separate segment for the BSS and dont intermix mmap and brk.
517thanks jibanes for reporting!
518
519
5202010-02-27
521futex, TLS, mprotect
522
523implemented sys_futex() finally
524
525changed tls to use the new /dev/gdt interface to change its
526process segment descriptors
527
528fixed mprotect
529
530
53120010-04-30
532linuxemu.rc gone, documentation
533
534removed linuxemu.rc and replaced it with linux.
535
536usage: linux [-h] [-d...] [-u uid] [-g gid] [-startx] [-display :n] [-e emubin] [-r linuxroot] command [args ...]
537
538linuxroot is now an optional parameter (-r). it will default to /sys/lib/linux.
539
540dont hide /lib/tls anymore and bind devarch. if you dont want to
541patch your kernel with the segdescr patch and use mroot[-linuxemu].tbz
542you can rename /lib/tls to /lib/_tls_disabled_.
543
544
5452010-05-02
546exit_group, exec, futex, waitpid, quoted arguments
547
548properly implement exit_group and zap all threads. notify
549all parent threads.
550
551zap threads in exec.
552
553implement FUTEX_REQUEUE and FUTEX_CMP_REQUEUE.
554
555handle WALL, WCLONE and WNOHANG in waitpid.
556
557preserve quoted arguments to linux.
558
559
5602010-05-11
561select/poll and EBADF, execve malloc, set_thread_area, initproc, SIGSTOP/SIGCONT,
562tty, getsid, getpeeraddr, /proc
563
564select and poll never return -EBADF but ignore the offending
565filedescriptor. this is wrong in the manpage! (this was needed
566to survive the python configure script)
567
568handle malloc errors in execve and dont panic when elf
569loading fails but kill the process.
570
571detect empty descriptors in set_thread_area so descriptors
572can be freed.
573
574move some of the initialization from main to initproc.
575
576SIGSTOP/SIGCONT handling now works for thread groups. for this
577we now have stopproc() and contproc() that are called from the
578signal code when SIGSTOP or SIGCONT signal is received. each Uproc
579now has a traceproc callback that is called when we enter or
580exit the kernel. zapthreads() and stopproc() use this to get all threads
581in the wanted state. for stopped procs, waiting happens in
582the signal code so calling handlesignals() of a stopped proc will
583block until it gets killed or continued.
584
585new fields in Uproc:
586traceproc, tracearg - called when entering or exiting the kernel
587wstate - current wait state of this process. WEXITED, WSTOPPED, WCONTINUED.
588wevent - like wstate, but reset by waitpid
589comm - double null terminated string array. first entry is the full exe name
590followd by the exeve arguments.
591
592heres a new format %S for signal numbers.
593
594the per thread tty is gone. the tty is now in the per process signal queue.
595gettty() and settty() can be used to modify it. ptydev now allows opening
596the slave tty multiple times. (fixes midnight commander error)
597
598implemented sys_getsid().
599
600fix AF_INET padding and byte order for getpeername socketcall.
601
602implemented /proc (procdev). fddev is gone. /dev/tty handled by
603ptydev now. this makes pkill, ps, top and inkscape work!
604
605
6062010-05-28
607fixed pipe filedescriptor leak in AF_UNIX
608
609we leaked the sock->other descriptor when failing to connect
610a AF_UNIX socket. thanks yarikos for reporting!
611
612
6132011-08-05
614rename to existing symlink target bug, profine -> profile
615
616renaming a symlink to a existing symlink would cause the
617file file to be renamed to .udir.L.udir.L....
618
619fix profine/profile typo
620
6212014-11-20
622change uname release to 3.2.1 to make debian 7.0 not complain
623(thanks henesy)