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 ... , 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
Daxziz



Joined: 29 Dec 2005
Posts: 33

PostPosted: Sat Jun 03, 2017 10:39 pm    Post subject: Reply with quote

I think it's important to document the non-progress as well. It shows the steps taken and the thoughts behind them.


-Daxziz
Back to top
View user's profile Send private message
neozeed



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

PostPosted: Mon Jun 05, 2017 9:29 pm    Post subject: Reply with quote

Because I'm not good with diff or sed....

change the 1.1 license to 2.0

Code:
find . -type f -exec sed -i "s/Copyright (c) 1999 Apple Computer, Inc. All rights reserved./Copyright (c) 2000 Apple Computer, Inc. All rights reserved./g" {} \;
find . -type f -exec sed -i "s/Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights/The contents of this file constitute Original Code as defined in and/g" {} \;
find . -type f -exec sed -i "s/Reserved.  This file contains Original Code and\/or Modifications of/are subject to the Apple Public Source License Version 1\.1 \(the/g" {} \;

find . -type f -exec sed -i "s/Original Code as defined in and that are subject to the Apple Public/\"License\"\).  You may not use this file except in compliance with the/g" {} \;
find . -type f -exec sed -i "s/Source License Version 1.1 (the \"License\").  You may not use this file/License.  Please obtain a copy of the License at/g" {} \;
find . -type f -exec sed -i "s/except in compliance with the License.  Please obtain a copy of the/http:\/\/www.apple.com\/publicsource and read it before using this file./g" {} \;
find . -type f -exec sed -i "s/The Original Code and all software distributed under the License are/This Original Code and all software distributed under the License are/g" {} \;


find . -type f -exec sed -i "/ * License at http:\/\/www.apple.com\/publicsource and read it before using/d" {} \;
find . -type f -exec sed -i "s/ * this file./thislineneedstobedeleted/g" {} \;
find . -type f -exec sed -i "/ *thislineneedstobedeleted/d" {} \;


to get a better handle on changes in the BSD kernel going from Rhapsody to XNU

http://unix.superglobalmegacorp.com/cgi-bin/cvsweb.cgi/kernel-bsd/?cvsroot=DarwinBSD;only_with_tag=MAIN
_________________
# 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: Thu Jun 08, 2017 7:56 am    Post subject: Reply with quote

spot the difference?

Code:
[vdarwin:/usr/src/srcroot_lastknowngood] root# diff -ruN cc-1 /tmp/cc-1
[vdarwin:/usr/src/srcroot_lastknowngood] root# du -ks cc-1
25239   cc-1
[vdarwin:/usr/src/srcroot_lastknowngood] root# du -ks /tmp/cc-1
25239   /tmp/cc-1


Sure looks identical, right? except one builds, the other does not. Mad
_________________
# 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 Jun 08, 2017 8:28 am    Post subject: Reply with quote

neozeed wrote:
spot the difference?

Code:
[vdarwin:/usr/src/srcroot_lastknowngood] root# diff -ruN cc-1 /tmp/cc-1
[vdarwin:/usr/src/srcroot_lastknowngood] root# du -ks cc-1
25239   cc-1
[vdarwin:/usr/src/srcroot_lastknowngood] root# du -ks /tmp/cc-1
25239   /tmp/cc-1


Sure looks identical, right? except one builds, the other does not. Mad


How is that even remotely possible? Maybe file permissions? Maybe you run out of enough free space to build the second one? Cannot really see any other possibilities...
Back to top
View user's profile Send private message
neozeed



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

PostPosted: Thu Jun 08, 2017 8:35 am    Post subject: Reply with quote

t-rexky wrote:


How is that even remotely possible? Maybe file permissions? Maybe you run out of enough free space to build the second one? Cannot really see any other possibilities...


I'm totally at a loss. In between stuff, I know all the tools love CVS, so I setup a CVS server, committed my source tree, fetched it, and about 10 things fail to build, they all fail in some weird desire for textinfo, meanwhile the originals that diff with zero compares build without issue.

Granted I'm 100% n00b with apt/Deb and without ncommander I know I'd probably skip the package / build stuff all together, but yeah it's .. weird.
_________________
# 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 Jun 08, 2017 8:49 am    Post subject: Reply with quote

This reminds me of the onslaught of voodoo that I have experienced while trying to build gcc and some other gnu tools on NS3.3.

If you look at any of my diffs you will see weirdness in the configure scripts, for example, where I had to add fluff text characters because creating a file on NS3.3 of zero length and then appending to it later sometimes results in random binary garbage being inserted into the file. This is not supposed to happen unless you are using -posix, but it obviously is happening even without -posix. So it's either a kernel bug or a library bug in NS3.3 and it is really, really annoying.

This cannot be always reproduced so whenever I tried to identify the root cause I could not reproduce it, but whenever I was running the configure scripts it almost always happened. So I brute-force "fixed" it by avoiding creation of empty files that are appended to: they are created with some "fluff" content that avoids the bug.

This is just one thing, but the list of seemingly random weirdness goes on-and-on. I have, somewhere, NS3.3 "porting notes" from few years back. But one would think that they fixed all that stuff by the time Rhapsody came about...
Back to top
View user's profile Send private message
neozeed



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

PostPosted: Thu Jun 08, 2017 9:34 am    Post subject: Reply with quote

t-rexky wrote:
But one would think that they fixed all that stuff by the time Rhapsody came about...


NeXT really was a small company. And they did a lot of weirdisims to 'NIH' basically everything they touched. It sure is apparent in the Darwin source.

It's not like we have access to much older source to compare. I'm almost tempted to pony up $10k to find out.

Quote:
N5515 NeXT 2.0 Mach Source Release $10,000 (Q1) $5,000
on Floppies
(not in Fall 90 list prices


link for the curious

Although in 2017 I'm not sure what I'd even do with them. At any rate we have what we have, and it really is substantial. I'm just strungling a little with reproducibility and trying to mash more 1.0 into 0.3 ..

Actually I haven't even looked at the Rhapsody stuff for -posix / -lposix... I've always really thought it really was an overlay link library for SYSV terminal handling... Now I have the urge to boot up 3.3 and tear a little into -posix .. They at least did put the source to the compiler & ctools on the 3.3 dev cd.
_________________
# 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 Jun 08, 2017 9:48 am    Post subject: Reply with quote

neozeed wrote:
Actually I haven't even looked at the Rhapsody stuff for -posix / -lposix... I've always really thought it really was an overlay link library for SYSV terminal handling... Now I have the urge to boot up 3.3 and tear a little into -posix .. They at least did put the source to the compiler & ctools on the 3.3 dev cd.


Yeah, in 3.3 it was an add-on library that used a different csu to set-up the kernel. Looking at the historical posts about it it really seems like it was an afterthought for NeXT and they thought it would eventually go away. So I think they removed it from OPENSTEP because it was somewhat broken and they did not believe in it. I have not checked for anything POSIX related in Rhapsody, Darwin and OS X, but I assume that by virtue of being based off BSD 4.4 they inherently had some POSIX compliance. This would perhaps not even need a -posix flag since in NeXT days the flag activated a cludge of stuff in the headers and then used a different csu and added the libposix.a library...

This is an interesting quick read on BSD for those of us who don't know or remember the whole history: http://fhlug.at/wp/wp-content/uploads/2014/04/BSD-Slides.pdf

As far as the NS source is concerned we tried many times with Apple and never had any response. Big shame really...
Back to top
View user's profile Send private message
neozeed



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

PostPosted: Thu Jun 08, 2017 10:23 am    Post subject: Reply with quote

t-rexky wrote:

As far as the NS source is concerned we tried many times with Apple and never had any response. Big shame really...


Actually what I'm curious about is why all evidence of Darwin 0.x has been obliterated, and all of the mailing list posts before October 2001 were deleted.

If I had to bet, back in the day NeXT paid a lot of $$ to AT&T as a late company to the party to get a source license to 32v (and get enough rights to get CSRG work + CMU access + poach CMU staff) that maybe they had though about dumping the BSD aspect for SYSV like all the other 'business' companies out there (SGI/SUN/IBM) but couldn't just justify it.

But that is pure speculation on me.

I'm sure it's needed for something key to building NS, or the proverbial big customer otherwise it'd get dumped.
_________________
# 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 Jun 08, 2017 11:50 am    Post subject: Reply with quote

I think you are probably on to something here.

When you have a moment look at early OS X (10.2 maybe) cctools package source. I think it was in the Makefiles where there was a comment that it cannot be built for NEXTSTEP or OPENSTEP because of missing proprietary BSD bits. Or something along these lines.

Of course I conveniently circumvented this by borrowing the missing bits from NS and OS, as required, in my NS3.3 port of cctools.

(EDIT) here it is from https://opensource.apple.com/source/cctools/cctools-435.4/Makefile.auto.html:

Code:
# Note: For Darwin developers only building for current MacOS X release is
# supported.  The Openstep target will NOT build outside of Apple as it requires
# 4.3bsd licenced code.
Back to top
View user's profile Send private message
neozeed



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

PostPosted: Thu Jun 08, 2017 6:44 pm    Post subject: Reply with quote

t-rexky wrote:
I think you are probably on to something here.

When you have a moment look at early OS X (10.2 maybe) cctools package source. I think it was in the Makefiles where there was a comment that it cannot be built for NEXTSTEP or OPENSTEP because of missing proprietary BSD bits. Or something along these lines.

Of course I conveniently circumvented this by borrowing the missing bits from NS and OS, as required, in my NS3.3 port of cctools.

(EDIT) here it is from https://opensource.apple.com/source/cctools/cctools-435.4/Makefile.auto.html:

Code:
# Note: For Darwin developers only building for current MacOS X release is
# supported.  The Openstep target will NOT build outside of Apple as it requires
# 4.3bsd licenced code.


After 32v was made free per Caldera ( http://www.lemis.com/grog/UNIX/ ) was there hidden secret 4.3BSD? Or were they just scared and not desiring to possibly embroiled in any SCO suits?

Naturally moving to "cleaner" OSF/mk NetBSD/FreeBSD would sure make sense...

Also the HFS driver source has a lot of OS 8.1 looking stuff, + a MacOS call emulator. I've built the AppleTalk stuff, I haven't tried to use it though.
_________________
# 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: Fri Jun 09, 2017 7:44 am    Post subject: Reply with quote

so I just noticed in Darwin that in 0.3 HFS is disabled on the i386 kernel. Turning it on gives me a panic with

v_usecount

I hammered the 1.0 HFS in there as it does allow mounting root and other fun stuff, and it panics with:

lockmgr: locking against myself

..... non progress..progress...
_________________
# include <wittycomment.h>
Back to top
View user's profile Send private message Visit poster's website
NCommander



Joined: 11 Mar 2017
Posts: 55
Location: New York, NY

PostPosted: Fri Jun 09, 2017 4:54 pm    Post subject: Reply with quote

I'm still around but I'm not checking in on a daily basis. We're nearing a major product release at work and free time and my willingness to work on anything technological in my downtime isn't exactly strong.

For cctools, the underlying problem is GCC has a bootstrapping problem; you need bits of the system its targetting to bootstrap it at all. Generally speaking, that's libc (or libSystem in NeXT/OSX), the CRT (usually called Csu (C Startup Unit), and kernel headers.

Based on what I saw in Mach, the pre-Darwin source almost certainly had BSD 4.4 stuff that was replaced rather rapidly by Apple where possible. Compare kernel headers from OPENSTEP -> Darwin to see what I mean. Based off my memory, the HFS driver port basically came lifted right from classic Mac OS.

32v wasn't free at the time. Originally, the antique UNIX/BSDs were only available under a non-commerical license. We're talking 1999/2000 timeframe here.

You're getting texinfo failures because you changed the modification dates (CVS does not perserve these on import as per my memory). Autotools will NOT rebuild tex files unless the source file is newer than the older. Then you open the path to madness.

EDIT: Darwin 0.x still had BSD code in it. See mach's FFS support from BSD. It would also explain why UFS broke if they were in the process of replacing it from the legacy BSD 4.x version with code from FreeBSD. That's probably the reason it was pulled is that no one realized that was still there since neither NeXT or Mac OS X officially supported FFS as far as I know.
Back to top
View user's profile Send private message
neozeed



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

PostPosted: Fri Jun 09, 2017 6:56 pm    Post subject: Reply with quote

NCommander wrote:
I'm still around but I'm not checking in on a daily basis. We're nearing a major product release at work and free time and my willingness to work on anything technological in my downtime isn't exactly strong.

For cctools, the underlying problem is GCC has a bootstrapping problem; you need bits of the system its targetting to bootstrap it at all. Generally speaking, that's libc (or libSystem in NeXT/OSX), the CRT (usually called Csu (C Startup Unit), and kernel headers.

Based on what I saw in Mach, the pre-Darwin source almost certainly had BSD 4.4 stuff that was replaced rather rapidly by Apple where possible. Compare kernel headers from OPENSTEP -> Darwin to see what I mean. Based off my memory, the HFS driver port basically came lifted right from classic Mac OS.

32v wasn't free at the time. Originally, the antique UNIX/BSDs were only available under a non-commerical license. We're talking 1999/2000 timeframe here.

You're getting texinfo failures because you changed the modification dates (CVS does not perserve these on import as per my memory). Autotools will NOT rebuild tex files unless the source file is newer than the older. Then you open the path to madness.

EDIT: Darwin 0.x still had BSD code in it. See mach's FFS support from BSD. It would also explain why UFS broke if they were in the process of replacing it from the legacy BSD 4.x version with code from FreeBSD. That's probably the reason it was pulled is that no one realized that was still there since neither NeXT or Mac OS X officially supported FFS as far as I know.


That makes more sense, I didn't check date time modifications. I grabbed the nextified textools from 10.3 and other than some .Po files the makefile tries to include, it'll build and I used that to sidestep that issue.

I now need a gperf, but apparently there is no libstdc++ .. I'll try just retouching everything to the old.

Speaking of dates, you are right again in 99 32v was still proprietary. I somehow got on the TUHS list in 97 or so, and bought a SYSIII 'hobbiest' license so I had access. I guess I'm one of the few lucky personal UNIX ones out there....

What worries me about HFS is that it compiles fine, but the kernel panics with no HFS volumes attached. I made some changes to get Darwin 1.0 HFS into the kernel and yeah, it crashes too. I also did FFS, and ... Same thing.

I'll have to break down and see if there is i386 binaries in the Darwin 1.0 dist. As it too is chicken and egg... At least Darwin 1.4 has an x86 CD. It looks like the original Darwin x86 that was 1.2 or so is lost to time save a screenshot. They were cross compiling from a PowerPC, and using Virtual PC.

I guess the sensible thing is to try to find a level where HFS works on x86 and backport the entire VFS.

I tried disabling stuff like NFS, but it looks like it has hooks for it all over....

I almost wonder if the entire bsd directory could be wholesale moved over........

Now that I think about it I need to check the call table, as 1.0 certainly added a copyfile API call.

I have a contract with a vendor and I have to use supplied equipment. It crashes hard yesterday. Nothing like unexpected free 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: Fri Jun 09, 2017 7:46 pm    Post subject: Reply with quote

The earliest x86 Darwin image that I have is darwinx86-141.iso. I have DarwinOS-0.3.toast, DarwinOS-1.0.toast and DarwinOS-1.0.2.dmg, but those are most certainly PPC binaries...
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 ... , 12, 13, 14  Next
Page 13 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