Compiling UNIX System V

I tried to install UNIX system v R4, but the sources i've found(archive.org and WinWorldPC) are incomplete (missing cc, for example). Since archive.org has the source files i thought i could compile it and upload it for other users, but i cant get it to work. Any advice?

You tried installing on what architecture UNIX system v R4 exactly?

On 32bit Virtualbox. And the install part succeded, but the problem are the missing programs

What do you mean, " i cant get it ( cc ) to work." ?

What errors do you get?

What happens when you check the type of the binary file, etc.?

This is a rare question indeed for this forum.

What are you trying to do???? And why???????

You are missing the point here my friend. You downloaded the entire source code for your O/S of choice so you have the source code of the C compiler, the source code of all shared libraries, the source code for the shells, et al. You do not have any executables!!!

So the question that you are really asking is:
Q: How do I compile a compiler without a compiler?
A: You need to 'seed' the operation via a closely related Unix/Linux version. Install a closely related foreign version and compile the entire toolchain first. Having generated your toolchain this way, you then need to compile the toolchain AGAIN using the tools that you just generated because, for example, all your libraries will have been created cross-compiled. To get them pure you need to do it all a third time.

Once you've got a complete toolchain you can begin to compile your kernel (bespoke or not, as your choice). When the kernel is created you can install grub and boot your own kernel. Then you can continue to create all other application and things.

So, what are you trying to do? Compiling your kernel can take hundreds of hours at 100% CPU. Then you test it, realize it's wrong, and have to do it all again. It's very difficult to create bespoke O/S for multi-nationals, public services, defense contractors, etc which I know to my cost. I do it all the time. You also need an extensive knowledge of O/S internals so it's not an easy occupation.

2 Likes

The problem with the already compiled version is that is missing several executables that appear in the manual (the most important for what i want to do is the C compiler). To solve the problem i thought about compiling the OS, but i could't find anything on the internet about how to do it (and this seems very different to how the Linux kernel is compiled)

What would you recommend?

Well the C compiler was not free...
Hicks explained what its like when building an OS from scratch, he forgot the pain killing job of getting something to display on screen...
I tried early 90 to install ATT UNIX 386 V r3.2 from partial source, but I had the libs the C compiler and XX 5-1/4 floppies....
I started all again with my first linux ( a99p108 )in 93 and it was like hicks explains, the hardest for me was to start with gcc for dos to build your precompiler I had to call a friend who was good in C to help me through... then yes it takes time specially when you can only do that after work, the kernel compilation took a weekend ( it was a 486/66 ...) it was up on the 3rd weekend...
About UNIX V 386, it was not intented for PC at the time as you had XENIX for that, so the basic runtimes were for small to good sized server using intel 386 architecture for e.g. mulitusers to learn programming languages like C Pascal or Cobol using VT100 or WISE terminals connected using multiplexed serial ports, you come up installing that on fancy modern pentium architecture with graphics and I/O cards it never heard of, you are to build the missing drivers from scratch and that part is far from being easy

2 Likes

So how would i setup the system for compiling? Also, i'm not building one from scratch and i think that the source code is complete.

You start with, say, a Linux system. Put the sources there and use the Linux compiler - gcc to compile the sources. You should start with the compiler suite itself, (some) standard libraries, the linker, etc.. This is what hicksd8 means by "toolchain". Now you have a SysV-C-compiler that is compiled fo Linux. This is called "seeding", because ideally a compiler should be able to compile its own sources. That is: when you write a C-compiler in C you write it, then take another C-compiler and compile it, take that executable and use it to compile it again the original sources, then use that executable to compile it again. You then have a code that is compiled by the executable resulting from the very code its source has produced. From then on you use (the compiled) version X-1 to compile version X, etc.. Here you do basically the same for the whole OS.

Of course you build from scratch. You start with the sources for the OS and you want to have a compiled, running and installed OS. That is as much "from scratch" as it can get.

I hope this helps.

bakunin

2 Likes

as far as I remember a Lattice C distributed by Microsoft. One reason of the many Microsoft copyrights booting SysV.

So i've tried compiling the toolset, but it copies the one on my system, and that one doesn't work on UNIX. Where could i get an older toolset (compiler+linker, basically)? And the source looks like its designed to be built from an UNIX system, but its arount 40MB, and UNIX doesn't seem to be able to read floppies bigger that 1.44 MB. Is there a way to copy something that size? I'm using Virtualbox