NeXT Computers Forum Index NeXT Computers
www.NeXTComputers.org
 
Log in to check your private messagesLog in to check your private messages

Log inLog in  RegisterRegister


Profile  Search  Memberlist  FAQ  Usergroups
Taking the NeXT step (mach kernel upgrades)
Goto page Previous  1, 2, 3, 4, 5, 6 ... 12, 13, 14  Next
 
Post new topic   Reply to topic    NeXT Computers Forum Index -> Porting New Software
View previous topic :: View next topic  
Author Message
neozeed



Joined: 15 Apr 2006
Posts: 685
Location: Hong Kong

PostPosted: Fri Apr 21, 2017 11:35 pm    Post subject: Reply with quote

For anyone who wants to just run the binaries, first install Rhapsody DR2.

I don't know enough about NS/OS/Rh to make a standalone system. So we are going to do a cheap upgrade.

Once you have your DR2 installed, boot it into single user mode. (-s).

Then mount the root rw (it'll tell you how)

Then mount THIS CD-ROM IMAGE!


Code:

fsck -y /dev/hd0a
mount -w /
mkdir /tmp/CD
mount_cd9660 /dev/sd0a /tmp/CD
gzip -dc /tmp/CD/darwin01.gz | restore -rf -
reboot


It'll print a bunch of stuff, then once you are back to the prompt just type in reboot.
_________________
# include <wittycomment.h>
Back to top
View user's profile Send private message Visit poster's website
neozeed



Joined: 15 Apr 2006
Posts: 685
Location: Hong Kong

PostPosted: Sat Apr 22, 2017 8:25 pm    Post subject: Reply with quote

t-rexky wrote:
Very, very cool!

As a somewhat related side project, a few weeks ago I compiled a summary of NS / OS / Rhap / OS X kernel version evolution. I will post it in this thread in the next few days. Just for reference...

Edit - here it is: https://www.flickr.com/photos/t-rexky/shares/3a52Z4


Kernel version 'kernel-154.5.1-7.tar.gz' is Darwin 0.3 ... !
_________________
# include <wittycomment.h>
Back to top
View user's profile Send private message Visit poster's website
t-rexky



Joined: 09 Jan 2011
Posts: 271
Location: Snowy Canada

PostPosted: Sat Apr 22, 2017 8:33 pm    Post subject: Reply with quote

neozeed wrote:
Kernel version 'kernel-154.5.1-7.tar.gz' is Darwin 0.3 ... !


I did not think the kernel was modified from Darwin 0.1 to Darwin 0.3. I cannot find any evidence to the contrary. Even the sources found online and on your server for Darwin 0.3 kernel diff'd against the Darwin 0.1 kernel source are identical...

Edit: UHOH, I found your other post! You can send me the image if you'd like and I can export it. But a toast image should be just an ISO I think. Did you try mounting it as ISO?
Back to top
View user's profile Send private message
neozeed



Joined: 15 Apr 2006
Posts: 685
Location: Hong Kong

PostPosted: Sat Apr 22, 2017 9:11 pm    Post subject: Reply with quote

t-rexky wrote:
neozeed wrote:
Kernel version 'kernel-154.5.1-7.tar.gz' is Darwin 0.3 ... !


I did not think the kernel was modified from Darwin 0.1 to Darwin 0.3. I cannot find any evidence to the contrary. Even the sources found online and on your server for Darwin 0.3 kernel diff'd against the Darwin 0.1 kernel source are identical...

Edit: UHOH, I found your other post! You can send me the image if you'd like and I can export it. But a toast image should be just an ISO I think. Did you try mounting it as ISO?


I'm still downloading it! ... the connection is quite slow and seems to be prone to connection issues. My home has a 1GB connection and I get timeouts. I rent a server in Chicago, and it's also frought with issues..

I currently have 110MB of 650MB of this toast image. I've just run strings against it to see what was in the header... I'm not sure how to best mount this toast image, I guess its HFS so I'll need a toast capable mac.

They also have a Darwin 1.0 toast image, I'll get that next for the sake of comparissons...
Maybe we already have Darwin 0.3 ....?

The file Im excited about is called "drvEIDE-33-1.tar.gz" ....


Some glimpse of information from the era:

http://macosx-admin.omnigroup.narkive.com/xmCB6wzs/version-of-osx
_________________
# include <wittycomment.h>
Back to top
View user's profile Send private message Visit poster's website
neozeed



Joined: 15 Apr 2006
Posts: 685
Location: Hong Kong

PostPosted: Sun Apr 23, 2017 12:26 am    Post subject: Reply with quote

OK I got the files off the toast images... that was another adventure in it's self.


Darwin 0.3 is 99% the same as Darwin 0.1

HOWEVER there is source to the EIDE driver! yay so it's not a total loss.

99% of the kernel changes are:

Code:
--- kernel-1/vm/vnode_pager.h   1999-03-16 10:56:09.000000000 -0600
+++ kernel-7/vm/vnode_pager.h   1999-07-22 17:58:33.000000000 -0500
@@ -3,21 +3,21 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  *
- * "Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
  * Reserved.  This file contains Original Code and/or Modifications of
  * Original Code as defined in and that are subject to the Apple Public
- * Source License Version 1.0 (the 'License').  You may not use this file
+ * Source License Version 1.1 (the "License").  You may not use this file
  * except in compliance with the License.  Please obtain a copy of the
  * License at http://www.apple.com/publicsource and read it before using
  * this file.
  *
  * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT.  Please see the
  * License for the specific language governing rights and limitations
- * under the License."
+ * under the License.
  *
  * @APPLE_LICENSE_HEADER_END@
  */


the biggest change is a new boot logo, and it looks like a bunch of USB PowerPC stuff was deleted in the kernel. I have a 3MB diff of the 0.1 & 0.3 kernel, I just quickly looked at it, so maybe there is more.

I'll have to check some of the other files to see if they are also just largely a license change from source license 1.0 to 1.1
_________________
# include <wittycomment.h>
Back to top
View user's profile Send private message Visit poster's website
neozeed



Joined: 15 Apr 2006
Posts: 685
Location: Hong Kong

PostPosted: Sun Apr 23, 2017 2:06 am    Post subject: Reply with quote

So yeah same logo... and new version # to further complicate things.


Code:



4.4 BSD (rhapsody) (ttyp0)

login: root
Welcome to Rhapsody!

You have mail.
rhapsody:1# dmesg
Kernel Release 0.3:
Sun Apr 23 02:04:16 PDT 2017; root
Copyright (c) 1988-1995,1997-1999 Apple Computer, Inc. All Rights Reserved.

physical memory = 64.00 megabytes.
using 227 buffers containing 1.27 megabytes of memory
available memory = 59.19 megabytes. vm_page_free_count = 1d99
minimum quantum is 10 ms
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.

PCI Ver=2.10 BusCount=1 Features=[ BIOS16 CM1 ]
Found PCI 2.0 device: ID=0x12378086 at Dev=0 Func=0 Bus=0
Found PCI 2.0 device: ID=0x70008086 at Dev=1 Func=0 Bus=0
Found PCI 2.0 device: ID=0x70108086 at Dev=1 Func=1 Bus=0
Found PCI 2.0 device: ID=0x00a81013 at Dev=2 Func=0 Bus=0
Found PCI 2.0 device: ID=0x802910ec at Dev=3 Func=0 Bus=0
PCI bus support enabled
PnP: Plug and Play support enabled
ISA/EISA bus support enabled
ISA bus
DriverKit version 500
hc0: device detected at port 0x1f0 irq 14
hc0: Checking for ATA drive 0...  Detected
hc0: Checking for ATA drive 1...
hc0: Checking for ATAPI drive 1...
hc0: Resetting drives...
Registering: hc0
hd0: QEMU HARDDISK 0.9.0
hd0: 4063 cylinders, 16 heads, 63 spt (disk geometry)
hd0: using single sector transfers.
Registering: hd0
hd0: Device Block Size: 512 bytes
hd0: Device Capacity:   1999 MB
hd0: Disk Label:        Disk
hc1: device detected at port 0x170 irq 15
hc1: Checking for ATA drive 0...
hc1: Checking for ATAPI drive 0... Detected
hc1: Checking for ATA drive 1...
hc1: Checking for ATAPI drive 1...
hc1: Resetting drives...
hc1: Drive 0: ATAPI CD-ROM (FAST DRQ, REMOVABLE, CMD PKT LEN=12)
hc1: LBA supported.
hc1: buffer type 3, 512 sectors.
Registering: hc1
IDEDisk: disk 0 is ATAPI
Registering: sc0
SCSIDisk: sc0 does not support ClientThreads selector, using default
sd0: QEMU QEMU CD-ROM 0.9.
Registering: sd0 at Target 0 LUN 0 at sc0
sd0: Disk Not Ready
SCSIDisk: sc0 does not support ClientThreads selector, using default
Registering: fc0
Registering: PS2Controller
Registering: PCKeyboard0
PCI bus support enabled
Registering: PCI0
Registering: EISA0
Registering: event0
Registering: kmDevice0
rootdev 300, howto 40000
BusMouse mouseInit: no resolution in config table.  Default is 400
Bus mouse running
Registering: BusMouse
Display0: Cirrus Logic GD5434 detected (2097152 Bytes)
Display0: PCI Dev: 2 Func: 0 Bus: 0
Display: Mode selected: 800 x 600 @ 60 Hz (RGB:256/8)
Registering: Display0
NE2000 Generic Driver v0.9.1b
by Gabor Sebestyen

Vendor: RealTek RTL-8029
BASE: 0xc100; IRQ: 11
Registering: en0
en0: Ethernet address 52:54:00:12:34:56
Device inited...


So yeah, it's not a 5x kernel anymore but 0.3

Code:
rhapsody:2# uname -a
Darwin rhapsody 0.3 Kernel Release 0.3: Sun Apr 23 02:04:16 PDT 2017; root Copyright (c) 1988-1995,1997-1999 Apple Computer, Inc. All Rights Reserved.  i386

_________________
# include <wittycomment.h>
Back to top
View user's profile Send private message Visit poster's website
t-rexky



Joined: 09 Jan 2011
Posts: 271
Location: Snowy Canada

PostPosted: Sun Apr 23, 2017 3:55 am    Post subject: Reply with quote

Still very cool that you were able to find it!

In-between mourning one of my PowerMac G5 starting to exhibit some kind of hardware issue causing kernel panics, I was thinking a little bit of how to integrate this kernel into OS or NS. I think we would require some form of BSD 4.3 to BSD 4.4 call translation layer in order to allow the existing pre-compiled binaries to function. This is way beyond the capabilities of my grey matter Laughing
Back to top
View user's profile Send private message
neozeed



Joined: 15 Apr 2006
Posts: 685
Location: Hong Kong

PostPosted: Sun Apr 23, 2017 10:29 am    Post subject: Reply with quote

if it matters.........

Rhapsody only reads NeXTSTEP disks as read only.

so I instaleld NS 3.3, then went to make a dump on Rhapsody. Rhapsody can't dump NS 3.3 either. So added another disk, booted NS in single user mode, and dumped the install to another disk so I have a 'clean snapshot'. Created a backup Rhapsody disk, and restored nextstep into that.

copied in the new boot, the new kernel & overlaid the driver tree...

reboot and the nextstep scripts dont like the disk to be Read only on boot. So I altered the kernel to mount root as read write.

Code:
MNT_RDONLY
        mp->mnt_flag = MNT_RDONLY;


bsd/vfs/vfs_subr.c
bsd/sys/mount.h:#define MNT_RDONLY      0x00000001      /* read only filesystem */


It's a one liner (dont do it, no point right now). Anyways the scripts freak out as things like fsck won't work, so I comment them out. Darwin-7 then gives me some illegal instruction error when trying to load drivers. Darwin-1 (0.3/0.1) just hangs....

So it seems that the newer tools need to be compiled against older libraries if there is any hope at anything fusion with this stuff, as it's just too new.

As Im going to bed as apparently I have to work outdoors tomorrow... I found the missing bits from my building a bunch of stuff yesterday, my /System/Library/Frameworks/System.framework is missing stuff.. not sure what though, but it's too light. Also I need to see about building Message.framework and /usr/lib/dylib ... naturally there is apparently a lot of other things missing, but filling in those bits plus the Rhapsody boot stuff and pre-compiled drives, and I can drop to single user mode OK'ish.

Does anyone know how they used to make those 2048 byte read only CD-ROM UFS filesystems?

At some point I'd like to make one.
_________________
# include <wittycomment.h>
Back to top
View user's profile Send private message Visit poster's website
neozeed



Joined: 15 Apr 2006
Posts: 685
Location: Hong Kong

PostPosted: Sun Apr 23, 2017 7:28 pm    Post subject: Reply with quote

First I made a copy of the 2 kernels, as I'm going to alter and destroy stuff.

By default running diff gives me 3.9MB worth of changes, the vast majority of them are the license change from 1.0 to 1.1...

So I came up with this to fix up the licensing to match, and to fix a stupid hyphen typo.. Also to drop the ppc directories since I don't care about the PowerPC port.

Code:

find . -type f -exec sed -i "s/\"Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights/Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights/g" {} +
find . -type f -exec sed -i "s/Source License Version 1.0 (the 'License').  You may not use this file/Source License Version 1.1 (the \"License\").  You may not use this file/g" {} +
find . -type f -exec sed -i "s/distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER/distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY KIND, EITHER/g" {} +
find . -type f -exec sed -i 's/FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT.  Please see the/FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the/g' {} +
find . -type f -exec sed -i 's/under the License."/under the License./g' {} +
find ./ -name 'ppc' -exec rm -rf {} \;
find ./ -name '*ppc*' -exec rm -f {} \;


Now I have a 69Kb diff, much more managable.

There is some TCP/IP fixes, and more debugging added into NFS.

And of course this change:


Code:
diff -ruN kernel-1/conf/tools/newvers/newvers.csh kernel-7/conf/tools/newvers/newvers.csh
--- kernel-1/conf/tools/newvers/newvers.csh   2017-04-23 21:34:14.451506589 -0500
+++ kernel-7/conf/tools/newvers/newvers.csh   2017-04-23 21:34:12.875506633 -0500
@@ -47,9 +47,9 @@
   /bin/echo "int  version_major      = ${major};" ;
   /bin/echo "int  version_minor      = ${minor};" ;
   /bin/echo "char version_variant[]  = \"${variant}\";" ;
-  /bin/echo "char version[] = \"Kernel Release ${v}:\\n${t}; $w($h):$d\\nCopyright (c) 1988-1995,1997-1999 Apple Computer, Inc. All Rights Reserved.\\n\\n\";" ;
+  /bin/echo "char version[] = \"Kernel Release ${v}:\\n${t}; $w\\nCopyright (c) 1988-1995,1997-1999 Apple Computer, Inc. All Rights Reserved.\\n\\n\";" ;
   /bin/echo "char osrelease[] = \"${major}.${minor}\";" ;
-  /bin/echo "char ostype[] = \"Rhapsody\";" ;
+  /bin/echo "char ostype[] = \"Darwin\";" ;
 ) > vers.c
 if [ -s vers.suffix -o ! -f vers.suffix ]; then
     rm -f vers.suffix
diff -ruN kernel-1/conf/version.major kernel-7/conf/version.major
--- kernel-1/conf/version.major   2017-04-23 21:34:14.447506589 -0500
+++ kernel-7/conf/version.major   2017-04-23 21:34:12.867506633 -0500
@@ -1 +1 @@
-5
+0

_________________
# include <wittycomment.h>
Back to top
View user's profile Send private message Visit poster's website
Rob Blessin Black Hole
Site Admin


Joined: 05 Sep 2006
Posts: 587
Location: Ft. Collins, Colorado

PostPosted: Mon Apr 24, 2017 12:13 am    Post subject: Reply with quote

Hello Neo: Cool stuff !
_________________
Rob Blessin President computerpowwow ebay sales@blackholeinc.com http://www.blackholeinc.com
303-741-9998 Serving the NeXT Community since 2/9/93
Back to top
View user's profile Send private message Send e-mail Visit poster's website
neozeed



Joined: 15 Apr 2006
Posts: 685
Location: Hong Kong

PostPosted: Mon Apr 24, 2017 3:26 am    Post subject: Reply with quote

Rob Blessin Black Hole wrote:
Hello Neo: Cool stuff !


Yeah, sadly it's only exciting for Rhapsody... Although Darwin 0.1 and 0.3 seem to build best with themselves, it's quite the dance to update and go..

Apparently enough has shifted from the time of nextstep that I don't think this is all useful there.. maybe I can build the userland with the old /system I'm not sure, but not being able to mount or load drivers isn't very usefull... Unless you want to load nextstep in single user mode, or off the CD then it's awesome...
_________________
# include <wittycomment.h>
Back to top
View user's profile Send private message Visit poster's website
neozeed



Joined: 15 Apr 2006
Posts: 685
Location: Hong Kong

PostPosted: Wed Apr 26, 2017 5:19 am    Post subject: Reply with quote

Well the good news is that the EIDE driver source from 0.3 builds, and runs. The bad news is that it's just as defective as all the others.

There is something fundamentally flawed in the driver the way it triggers and expects interrupts, and something gets lost in the shuffle.

I had been thinking it was originally related to the 0x58 return codes, which in the world of LINUX was DMA problems ... So with source in hand I turn off the DMA, same error. I turn off the multi-sector read/writes since the Qemu090 detects in single mode, and it makes no difference. I limit it to a single controller, single drive, and it still happens, after issuing a read command.

Also when it resets the bus it does it in such a way that once more again the interrupts are lost and the devices just stop responding. Considering its broken on real hardware as well, it's safe to say that there is a fundamental problem with the EIDE driver, and I think it was never fixed, as even the old Darwin 1.x+++ on x86 releases also feature a flakey EIDE driver.

Since I'm already installed, I guess the way to proceed is to gut the driver to a super minimum, something that isn't the interdependent rats nest, and see if I can get something simple to work. Or try to trace raised and lowered IRQ's to see what on earth goes wrong. I donno unlike typing in 'make' this will take time. ....
_________________
# include <wittycomment.h>
Back to top
View user's profile Send private message Visit poster's website
t-rexky



Joined: 09 Jan 2011
Posts: 271
Location: Snowy Canada

PostPosted: Wed Apr 26, 2017 11:21 am    Post subject: Reply with quote

Just thinking out loud here...

Since Rhapsody kernel uses BSD 4.4 and NS/OS uses 4.3, we would most likely need some form of "translation" in the kernel in order for the old NS and OS libraries and binaries to work. If this indeed is the case, then the total scope of gluing-in the old kernel may not be significantly larger with OS X xnu kernel than it would be with the Rhapsody kernel.

The bonus is that on i386 xnu kernels have sufficient drivers to be usable through the old OpenDarwin initiative, etc...

On m68k, on the other hand, Rhapsody kernel would possibly integrate better since it's much closer to the NS/OS kernels.
Back to top
View user's profile Send private message
neozeed



Joined: 15 Apr 2006
Posts: 685
Location: Hong Kong

PostPosted: Wed Apr 26, 2017 5:50 pm    Post subject: Reply with quote

t-rexky wrote:
Just thinking out loud here...

Since Rhapsody kernel uses BSD 4.4 and NS/OS uses 4.3, we would most likely need some form of "translation" in the kernel in order for the old NS and OS libraries and binaries to work. If this indeed is the case, then the total scope of gluing-in the old kernel may not be significantly larger with OS X xnu kernel than it would be with the Rhapsody kernel.

The bonus is that on i386 xnu kernels have sufficient drivers to be usable through the old OpenDarwin initiative, etc...

On m68k, on the other hand, Rhapsody kernel would possibly integrate better since it's much closer to the NS/OS kernels.


The Rhapsody kernel can mount up the NS/OS CD's just fine, and execute binaries. The problem starts when executable want to talk to kernel level stuff, and all hell breaks loose. But I've seen this before as old BSD stuff, when you built a new kernel commands like dmesg and ps would stop working and you'd have to re-build those as well. Not to mention since the Rhapsody kernel will only mount nextstep read only, my transported copy onto a rhapsody filesystem means that command like fsck obviously won't work.
_________________
# include <wittycomment.h>
Back to top
View user's profile Send private message Visit poster's website
t-rexky



Joined: 09 Jan 2011
Posts: 271
Location: Snowy Canada

PostPosted: Thu Apr 27, 2017 9:33 am    Post subject: Reply with quote

Indeed. This is why I assumed that there would be a need for a kernel level "translation" such that the kernel would know the calling function is expecting BSD 4.3 behaviour.

I wish I had some time to tinker but I will not have that luxury for a while. Not that I know what I'm doing, but it would be fun anyway.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    NeXT Computers Forum Index -> Porting New Software All times are GMT - 7 Hours
Goto page Previous  1, 2, 3, 4, 5, 6 ... 12, 13, 14  Next
Page 5 of 14

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2017 phpBB Group