From: Mike S. <msl...@co...> - 2003-07-25 19:29:45
|
Hi All, The patch for Darwin real mode under X is ready and attached. Please expand and untar the file under your BasiliskII directory. Then run the included patchall.sh script. I have verified that direct and bacnks modes work as well. To build with real addressing mode use: ./autogen.sh --enable-addressing=real There is one potential serious bug I found along the way but I am not confident enough to say so. In posix_sem.cpp there is line that contains: nanosleep(NULL, &req); But nanosleep takes as its first parameter how long to sleep and as its second it fills in how much time remained for the sleep. This will make the while loop very rapidly, but maybe that was the intention? I beleive that the the code should in fact be: nanosleep(&req, NULL); but I left it the old way and added a stupid comment until I hear from someone with a more definitive answer. There are some new files: ? src/Unix/bless.sh ? src/Unix/Darwin ? src/Unix/Darwin/lowmem.c ? src/Unix/Darwin/pagezero.c ? src/Unix/Darwin/sys_darwin.cpp ? src/Unix/Darwin/testlmem.sh ? src/Unix/posix_sem.h You will notice a new directory src/Unix/Darwin. This is where all of the Darwin under X specific stuff goes. bless.sh and Darwin/testlmem.sh have to have execute bits set. bless.sh is a simple shell script that returns success. It is needed because there is a new step in the build process that I call blessing the executable. In the case of Darwin it allows for Basilisk access to low memory globals. In all other systems this bless.sh script is called which does nothing. The rule creates a file named blessed if it succeeds and this is how make knows whether that step has been performed. Darwin/testlmem.sh is a test that is run from configure that checks to see if the Mach-O hack to enable low mem globals works. posix_sem.h used to be named semaphore.h but for whatever reason my setup on FreeBSD the preprocessor would keep including this semaphore.h instead of the one in /usr/include even when I used the <> form instead of the "" form. I made some changes to semaphore.h so that it picks the correct semaphore.h from the system includes and works around systems like Darwin when there is a sem_init but it is unimplemented. Then I renamed it to posix_sem.h to match the posix_sem.cpp. All the UNIX code that needs semaphores simply includes posix_sem.h and this does the right stuff based on the configure test results. The other files that changed were: M src/Unix/Makefile.in M src/Unix/acinclude.m4 M src/Unix/audio_oss_esd.cpp M src/Unix/configure.ac M src/Unix/ether_unix.cpp M src/Unix/main_unix.cpp M src/Unix/posix_sem.cpp M src/Unix/serial_unix.cpp M src/Unix/sigsegv.cpp M src/Unix/sigsegv.h M src/Unix/sys_unix.cpp M src/Unix/video_vosf.h M src/Unix/vm_alloc.h M src/Unix/Irix/audio_irix.cpp M src/Unix/Solaris/audio_solaris.cpp I rolled the Mach exception handling mechanisms into sigsegv.cpp and this is the major reason this patch took me a whle to prepare. This way the Mach code is less likely to break over time. People might verify that I have not broken any of the sigsegv code on their favorite systems. I was pretty careful about the changes and I verified that it still works on FreeBSD. In traditional Mach you do not get the GPR's and faulting PC on the exception. It takes more work to get this info but it is not needed for the VOSF code. I changed the VOSF handler to take the faulting address as it sole parameter. This makes the common case, VOSF handling, faster under Mach. ignoresegv also works under Darwin. At one point I noticed that if you had seriala or serialb in your .basilisk_ii_prefs file the emulator would hang. Nigel's Aqua version of the emulator puts that into the file. If that happens, just remove those entries and it should run again. It seems that the emulator would try to do serial even if the device files specified did not exist. I do not know if that is still a problem. On my home machine Nigel's Aqua version takes 24s to startup while this X version takes only 9s. It is pretty straight forward to make changes to the the Aqua version to enable real mode. I had it for an earlier version without the VOSF support. There was a roughly two fold improvement in performance. I will work on getting that patch together next week but as it is that the Aqua version does not build out of cvs without some small tweaks, maybe Nigel has some patches that he might want to send out first. Also, Brian independantly discovered the same EGREP configure script problem I fixed as well. It really is a quoting problem, the yes should have been [yes], but I have used the test that autoconf itself uses of [choke me] instead of the recent commit with xyes which is not quoted correctly. mzs |