6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Wed Jun 05, 2024 12:27 pm

All times are UTC




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Sun Mar 21, 2021 7:01 pm 
Offline

Joined: Sat Apr 11, 2020 7:28 pm
Posts: 341
They say it's easy to port. There are versions for x86, 68k, z8000 and even 6809. It requires no MMU or FPU.

And the sources are available and open.

Would an existing C compiler be able to get this done?


Top
 Profile  
Reply with quote  
PostPosted: Sun Mar 21, 2021 8:14 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10822
Location: England
Interesting: a "highly compatible UNIX Version 7 lookalike"

See also here.

I think I'm right in saying that the only C compiler for the 816 is WDCs, and expensive... (Edit: but see below)


Last edited by BigEd on Sun Mar 21, 2021 8:45 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Sun Mar 21, 2021 8:39 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8198
Location: Midwestern USA
BigEd wrote:
See also here.

    Sure, the system was limited by the MMU of the 286 CPU, processes have a 64KB code and a 64KB data segment, same as UNIX V7 on the PDP-11...

Sounds somewhat like the 65C816, except unlike the 80286 brain-dead architecture, the 816's data segment can exceed 64KB, assuming the C compiler correctly utilizes indirect long addressing. In fact the only limit to the data segment's size would be the available RAM.

Quote:
I think I'm right in saying that the only C compiler for the 816 is WDCs, and expensive...

The WDC development package, which includes the C compiler, macro assembler and linker, may be
downloaded at no charge. I played around with the compiler in the past but haven't done anything with it for quite some time. It seems to produce reasonably succinct code, more-so for the 816 than the 65C02.

Coherent is something I was aware of for many years, but when I acquired reseller rights to SCO UNIX V3.2 (c. 1990) I went that route to build UNIX servers for clients. I wasn't aware that Coherent had been open-sourced. Perhaps it's time to take another look.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Sun Mar 21, 2021 8:46 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10822
Location: England
> downloaded at no charge
Ah, noted! (For non-commercial use, but that's not unexpected.)


Top
 Profile  
Reply with quote  
PostPosted: Sun Mar 21, 2021 8:54 pm 
Offline

Joined: Thu Mar 10, 2016 4:33 am
Posts: 170
I think Coherent includes a C compiler, so it mightn't be too hard to retarget that to the 65816. The easiest way to do this would be to get an existing Coherent port running and then create a cross compiler (and modified linker). Then recompile the compiler with the cross compiler to get a native version. There'd also be quite a bit of work in writing drivers, but a lot of things might be able to be reused, there's probably an existing SCSI driver that could be modified slightly (or IDE), and maybe all you'd need to get started would be a SCSI driver and serial driver.

This looks like a really interesting idea. It should run well on the 65816.


Top
 Profile  
Reply with quote  
PostPosted: Sun Mar 21, 2021 9:33 pm 
Offline

Joined: Mon Feb 15, 2021 2:11 am
Posts: 100
BigEd wrote:
Interesting: a "highly compatible UNIX Version 7 lookalike"

See also here.

I think I'm right in saying that the only C compiler for the 816 is WDCs, and expensive... (Edit: but see below)



There's also ports of the TCC and LCC compilers to 65816, but I've never tried them.

https://github.com/lcc-816/lcc-816
https://github.com/nArnoSNES/tcc-65816


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 22, 2021 1:50 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8198
Location: Midwestern USA
jds wrote:
I think Coherent includes a C compiler, so it mightn't be too hard to retarget that to the 65816. The easiest way to do this would be to get an existing Coherent port running and then create a cross compiler (and modified linker). Then recompile the compiler with the cross compiler to get a native version.

No need to jump through too many hoops. As long as one is willing to put up with Billy-ware (Windows), the WDC compiler should be fine. At least that compiler understands the 65C816 in native mode.

Quote:
There'd also be quite a bit of work in writing drivers, but a lot of things might be able to be reused, there's probably an existing SCSI driver that could be modified slightly (or IDE), and maybe all you'd need to get started would be a SCSI driver and serial driver.

Those of us who have built working 816 hardware will have likely already resolved the device driver matters. I have a working driver that supports four TIA-232 ports using a pair of NXP 28L92 DUARTs—that driver could be expanded to eight ports or more with little difficulty. Either way, several terminal log-in sessions would be possible. Plus the 28L92 has a precision timer that can be used to generate the all-important jiffy IRQ that the UNIX timekeeping and process scheduler code requires.

Naturally, some sort of random-access mass storage would be de rigueur on the target system. Also, a realistic port is going to require that the machine have at least 128 KB addressable space, otherwise space in bank $00 would quickly be consumed by competing processes. None of my working POC units would meet the address space requirement, but they do have SCSI. I would need to get POC V1.3 running to support the 128KB minimum. Alas, V1.3 has languished.

Quote:
This looks like a really interesting idea. It should run well on the 65816.

I would think so as well. There is no memory protection, so code discipline would be necessary in user-land to avoid contretemps. That said, the first ports of UNIX to the MC68000 had to work without memory protection (also the case with the Amiga's operating system) and only had "user" and "supervisor" MPU modes available to limit the damage a wild user application could cause. Despite that, the 68000 ports ran fine.

The first step would be to resolve any issues in getting a C compiler to compile the kernel source without complaints. Once that hurdle has been leaped then the machine-specific issues related to memory mapping, device drivers, etc., would have to be resolved.

Incidentally, "Mark Williams" wasn't a real person. :)

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 22, 2021 7:29 pm 
Offline

Joined: Mon Feb 15, 2021 2:11 am
Posts: 100
BigDumbDinosaur wrote:

Incidentally, "Mark Williams" wasn't a real person. :)


Near as I can tell from searching online, it was named after William Mark Swartz, who owned a chemical (paint?) company, and was the father of Robert Swartz, whose software company started as a subsidiary of it. Robert Swartz is the father of the late internet activist Aaron Swartz.


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 23, 2021 12:03 pm 
Offline

Joined: Sat Apr 11, 2020 7:28 pm
Posts: 341
Maybe you guys would like to take a peek here for clues.

https://www.autometer.de/unix4fun/coherent/


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 23, 2021 2:59 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8198
Location: Midwestern USA
tokafondo wrote:
Maybe you guys would like to take a peek here for clues.

https://www.autometer.de/unix4fun/coherent/

I've been there. There doesn't seem to be any source code on that site, only the distribution. Maybe I looked in the wrong places. I suspect the source code, if available, probably runs to 100-200 MB and is probably mostly K&R C, with some kernel sections in x86 assembly language.

At one time, SCO was making their 3.2v4.x UNIX freely available for download. I never looked into it, as by then, pretty much everything had gone to Linux and SCO had become a dirty word following their "Linux stole our code" lawsuits.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 23, 2021 6:20 pm 
Offline

Joined: Mon Feb 15, 2021 2:11 am
Posts: 100
BigDumbDinosaur wrote:
tokafondo wrote:
Maybe you guys would like to take a peek here for clues.

https://www.autometer.de/unix4fun/coherent/

I've been there. There doesn't seem to be any source code on that site, only the distribution. Maybe I looked in the wrong places. I suspect the source code, if available, probably runs to 100-200 MB and is probably mostly K&R C, with some kernel sections in x86 assembly language.

At one time, SCO was making their 3.2v4.x UNIX freely available for download. I never looked into it, as by then, pretty much everything had gone to Linux and SCO had become a dirty word following their "Linux stole our code" lawsuits.


There's a link from that page to http://www.nesssoftware.com/home/mwc/source.php, which does have sources (as a giant .tgz files) for COHERENT and XYBASIC available.

Also a link to http://gopher.muffinlabs.com/telefisk.org/coherent/ which looks to have source and other files related to COHERENT, again as compressed archives.

I see several GitHub repositories for it, but I haven't yet seen it uncompressed. May have to just download and uncompress to take a look. From what I've been able to find online, version 3 and earlier were completely 16 bit, version 4 was a mix of 32 and 16 bit and hence required at least a 386. If attempting to port to 65816 I would think that starting from v3 source would be preferable. But v3 is lacking in many features of a more-modern Unix-like. With V4 comes support for features like mice, networking, X11, etc.


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 23, 2021 6:26 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10822
Location: England
This is sounding pretty good!


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 23, 2021 9:02 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8198
Location: Midwestern USA
I found the source for what appears to be the constituent files of the V2 kernel. As expected, there is a vast sea of source files—connecting all the dots would be very time-consuming. Needless to say, porting to anything other than the 8086-80286 is going to be a major project. :shock: Whomever decides to undertake it had better have a lot of time on his or her hands.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 24, 2021 12:41 am 
Offline

Joined: Sat Apr 11, 2020 7:28 pm
Posts: 341
Well... it seems that it will be hard to port Coherent to the 65816, as the latest source were meant for the x86 platform.

I talked to Udo Munk and he told me that the 68000 port is just lostware, and the Z8000 port could, maybe, be in the hands of someone with a Commodore C900 or something.

So I think as BigDumbDinosaur says that this will be a lengthy task for people very decided into it happening.

So maybe there is another OS that could be ported to the 65816. One with sources available, and that would run in a computer with no MMU, like the Amiga 500.

Is there one? I think that yes, there is one. It's Minix!! [new thread]


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 24, 2021 1:06 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8198
Location: Midwestern USA
tokafondo wrote:
Well... it seems that it will be hard to port Coherent to the 65816, as the latest source were meant for the x86 platform.

Being written in C, the source is theoretically portable to the 65C816. As a practical matter, something such as an operating system is going to be unavoidably hardware-centric, and the few source files I read (ones that are low level) are definitely tailored to the x86. There are enough differences between the early x86 MPUs and the 816 that I think porting the hardware-specific stuff, especially memory management, is going to be a challenge.

Quote:
I talked to Udo Munk and he told me that the 68000 port is just lostware, and the Z8000 port could, maybe, be in the hands of someone with a Commodore C900 or something.

The Z8000 is closer to the fabric of the x86 family than it is to the 68000 or the 816. It's a shame the 68K version is apparently lost, as it would be much easier to port to the 816 than the others. Oh well!

Quote:
So I think as BigDumbDinosaur says that this will be a lengthy task for people very decided into it happening.

So maybe there is another OS that could be ported to the 65816. One with sources available, and that would run in a computer with no MMU, like the Amiga 500.

Given the time and effort it would require to port any operating system to 816 hardware—bear in mind that the machine architecture, not just the MPU, has to be factored into a port, which would be closer to a rewrite—I'd be more inclined to scratch-write my own kernel—reinventing the wheel, as it were, instead of figuring out how to put 816 tires on x86 wheels.

Quote:
Is there one? I think that yes, there is one. It's Minix!! [new thread]

There you go! Of course, Minix was targeted to x86 machinery, so I suspect the porting task would be as formidable as it would be with Coherent.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 18 guests


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 post attachments in this forum

Search for:
Jump to: