6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu May 09, 2024 8:03 am

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Sun Aug 27, 2023 7:56 am 
Offline

Joined: Mon May 01, 2017 7:13 am
Posts: 82
Onno Kortman has taken semu (https://github.com/sysprog21/semu), a minimal RISC-V emulator, and cross-compiled it with llvm-mos (https://llvm-mos.org/wiki/Welcome), an LLVM port to the MOS 6502 processor, in order to run Linux on the Commodore 64 with REU. Kortman writes: "The screenshots took VICE a couple hours in 'warp mode' to generate. So, as is, a real C64 should be able to boot Linux within a week or so."

https://github.com/onnokort/semu-c64

Click the image for animation.


Attachments:
File comment: Animation of an emulated Commodore 64 with REU loading Linux
boot_anim.gif
boot_anim.gif [ 2.03 MiB | Viewed 5097 times ]
Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 27, 2023 10:22 am 
Offline
User avatar

Joined: Fri Aug 03, 2018 8:52 am
Posts: 746
Location: Germany
that is really impressive!

1200% Speed of a 1MHz 6502 with a 20MHz 65816 co-processor works out to a 12MHz 6502 with a 240 MHz 65816.
just a tiny bit too much for a modern 10-20MHz 65816 based system to handle on it's own.

but calling the emulator "minimal" seems a bit... deceptive.
as besides the base ISA it also has the MUL/DIV and Atomic extensions, plus an MMU and multiple privilege levels.
there is technically no reason to have the MMU at all, as Linux doesn't technically require it (as seen by this hackaday post), which would save some performance.
but i do believe you still need the different privilege levels, though if you could get rid of those as well it would of course run even better.

and if you have the code at that point you might be able to use a compiler directly to the 65816 like Calypsi C, though i've tried to compile an older version of MINIX with it once and it had some internal errors and just gave up. so i doubt it would fare better with a Linux kernel.

oh well, the dream of having an actual OS running on a 65816 continues to be a dream


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 27, 2023 10:50 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10800
Location: England
Wonderful!


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 27, 2023 11:58 am 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1405
Location: Scotland
Proxy wrote:
oh well, the dream of having an actual OS running on a 65816 continues to be a dream


What's your definition of an actual OS?

Acorn did it way back with a port of their Acorn MOS in their Communicator, then Apple did their thing on the //gs ...

... Fast forward to a year or 2 back and I have my RubyOS'816 going - which is a command-line sort of thing that supports multi-tasking running on my '816 board at 16Mhz - all written in BCPL....

Under which I wrote a RISC-V 32IM emulator (in BCPL) which runs at about 2000 RV instructions/sec, so not going to win any speed records, but if I added the bare minimal MMU support then could it run Linux? Sure - it's a little RAM limited right now though (Has about 350KB free) but in a larger memory system then yes - but as above, slowly...

So it's a good academic/fun exercise but not really usable...

Cheers,

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 27, 2023 5:22 pm 
Offline
User avatar

Joined: Fri Aug 03, 2018 8:52 am
Posts: 746
Location: Germany
drogon wrote:
What's your definition of an actual OS?

i'd say something like MS-DOS 2.0 or above. a simple commandline interface where you can run internal commands or external programs. with driver support of course!
drivers would be IMO the most important part as they shift the hardware dependent parts of code away from the OS and user programs.
sadly implementing drivers is really damn difficult and while i want to try myself at making an OS with driver support, i'm still in the "writing down all my ideas and concepts to solve weird edge cases before even writing a single line of code" phase of the project, which is very difficult to break out of. :lol:

drogon wrote:
Acorn did it way back with a port of their Acorn MOS in their Communicator, then Apple did their thing on the //gs ...

main issues with porting Operating systems of older hardware like that is the hardware dependence, sometimes missing source code, and any kind of limitations that you wouldn't have on a more modern system (like the amount of RAM available).
i have been sort of thinking about porting something like GEOS, which seems similar enough to GS/OS, except GEOS has source code. but both are graphical OSes which would be amazing to have, but also seem more error prone compared to simple terminal based OSes.

drogon wrote:
... Fast forward to a year or 2 back and I have my RubyOS'816 going - which is a command-line sort of thing that supports multi-tasking running on my '816 board at 16Mhz - all written in BCPL....

which is pretty damn impressive!

drogon wrote:
Under which I wrote a RISC-V 32IM emulator (in BCPL) which runs at about 2000 RV instructions/sec, so not going to win any speed records, but if I added the bare minimal MMU support then could it run Linux? Sure - it's a little RAM limited right now though (Has about 350KB free) but in a larger memory system then yes - but as above, slowly...

So it's a good academic/fun exercise but not really usable...

well again, you don't need an MMU for linux, just a seperation between User and System mode. and even that might be optional.
if i had an actual C compiler for my SW32VM i could try stuff like this myself. it would likely run as slowly as a RISC-V emulator, but atleast instructions are only 16-bits wide instead of 32-bits like on RISC-V.... but i don't know if that makes up for much in terms of performance, something to test i guess.


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 27, 2023 8:08 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8177
Location: Midwestern USA
Proxy wrote:
oh well, the dream of having an actual OS running on a 65816 continues to be a dream

I guess the Apple ][GS didn’t have an operating system. :D

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


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 28, 2023 12:33 am 
Offline

Joined: Thu Jan 21, 2016 7:33 pm
Posts: 269
Location: Placerville, CA
Clearly, that was but a shared hallucination.


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 28, 2023 3:18 am 
Offline
User avatar

Joined: Fri Aug 03, 2018 8:52 am
Posts: 746
Location: Germany
yea yea, i forgot the Apple IIgs existed :p


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 28, 2023 5:15 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8177
Location: Midwestern USA
Proxy wrote:
yea yea, i forgot the Apple IIgs existed :p

I suspect most of the present-day employees at Apple don’t know it existed as well.  Their horizons likely only extend back to the genesis of the iPhone.

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


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 28, 2023 5:46 pm 
Offline

Joined: Mon May 01, 2017 7:13 am
Posts: 82
Someone has set up a livestream of Linux booting in real time on an actual C64: https://www.youtube.com/watch?v=g-36d07DfgI

EDIT: he's giving up at 12 hours. It will require approximately a week to boot Linux.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 8 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: