Linux on NeXT hardware

Started by ramalhais, September 24, 2022, 07:21:51 AM

Previous topic - Next topic

ramalhais

Hi!
I picked up an old Linux 2.1 port for the NeXT, ported it to Linux 6.0-rc6 and have it working on all NeXT variants on Previous (emulator).

Currently, only the framebuffer and keyboard work:
https://github.com/ramalhais/linux/releases/tag/NeXT-2022-09-24-03.03.43

Let me know how it goes if you try it on real hardware.

barcher174

Wow, thats impressive. What was the effort required?

ramalhais

Quote from: barcher174 on September 24, 2022, 01:43:23 PMWow, thats impressive. What was the effort required?

It was not easy, but i learned a lot. I did it this month of September on my spare time.

Rob Blessin Black Hole

#3
Totally cool , nice work I'll give it a try ! 

So I'm trying to envision this so Previous running on my Mac Mini ,  To get Linux running first sounds a bit complicated , I'll try

and we will probably need NeXT mouse driver foo lol ,

I wonder if there is an ADB mouse and Keyboard driver for Linux that would work for the NeXT Turbo V74 Rom Configuration which supports ADB ?

looks like this doc has clues on ADB for Linux https://sixfab.com/wp-content/uploads/2021/02/Telit_Modules_Linux_USB_Drivers_User_Guide_r9.pdf

Driver kit for NeXT may help in writing Linux Drivers https://www.nextcomputers.org/NeXTfiles/Docs/NeXTStep/3.3/nd/OperatingSystem/Part3_DriverKit/Concepts/1_Overview/Overview.htmld/index.html although it describes NeXTSTEP Intel drivers , how the heck does create  NeXT 68K driver?

 It would be  cool eventually to create a NeXT Linux App exactly like DayDream Darkmatter which boots Mac OS on NeXT Hardware which would reboot into Linux :)   Or an App like Soft PC or Executor which would let you run Linux apps in emulation on NeXT 68K hardware ?   

Is it also possible to use the Linux port to create a bootable fully compiled NeXT68KLinux iso  where you would simply be able to install it , now that would be fun .  A boot manager like partition manager so you would be able to chose the OS  , Previous may make this possible but it would be awesome to see it running on NeXT 68K   then a  hybrid GNUSTEP  Linux 68K hybrid  may warp out of the reality distortion field.
Rob Blessin President computerpowwow ebay  [email protected] http://www.blackholeinc.com
303-741-9998 Serving the NeXT Community  since 2/9/93

ramalhais

Quote from: Rob Blessin Black Hole on September 24, 2022, 05:41:37 PMTotally cool , nice work I'll give it a try ! 

So I'm trying to envision this so Previous running on my Mac Mini ,  To get Linux running first sounds a bit complicated , I'll try

and we will probably need NeXT mouse driver foo lol ,

I wonder if there is an ADB mouse and Keyboard driver for Linux that would work for the NeXT Turbo V74 Rom Configuration which supports ADB ?

looks like this doc has clues on ADB for Linux https://sixfab.com/wp-content/uploads/2021/02/Telit_Modules_Linux_USB_Drivers_User_Guide_r9.pdf

Driver kit for NeXT may help in writing Linux Drivers https://www.nextcomputers.org/NeXTfiles/Docs/NeXTStep/3.3/nd/OperatingSystem/Part3_DriverKit/Concepts/1_Overview/Overview.htmld/index.html although it describes NeXTSTEP Intel drivers , how the heck does create  NeXT 68K driver?

 It would be  cool eventually to create a NeXT Linux App exactly like DayDream Darkmatter which boots Mac OS on NeXT Hardware which would reboot into Linux :)   Or an App like Soft PC or Executor which would let you run Linux apps in emulation on NeXT 68K hardware ?   

Is it also possible to use the Linux port to create a bootable fully compiled NeXT68KLinux iso  where you would simply be able to install it , now that would be fun .  A boot manager like partition manager so you would be able to chose the OS  , Previous may make this possible but it would be awesome to see it running on NeXT 68K   then a  hybrid GNUSTEP  Linux 68K hybrid  may warp out of the reality distortion field.

If you're going to use Previous emulator, it will probably emulate the old style keyboards, so you can use any keyboard supported on the host running Previous.

BTW my changes are based on Zach Brown's port from 2000:
https://web.archive.org/web/20041009152212/http://www.zabbo.net/nextlinux/

eagle

Wait, just to make sure I'm understanding you... you took the old Linux m68k NeXT port and upgraded the kernel, and you're running that in Previous on a newer Mac/Windows system?  That's so cool.
My NeXTs:
NeXT Computer prototype (68030-25 x2, 68040-25)
Two NeXTstations (68040-25)
All mono


ramalhais

Quote from: ramalhais on September 28, 2022, 07:22:01 PMWe now have mouse, ethernet (except Turbo machines), and NFS working:
https://github.com/ramalhais/linux/releases/tag/build%2F2022-09-29-01.38.27_6.0.0-rc7_15380a2d84505779653afd66cc8d29f61fac8c1e

NFS is timing out while downloading files. It's probably some issue with the network driver  :'(

ramalhais

Ethernet now works on Turbos aswell. You need to configure twisted pair in Previous Networking config.
I'm still having some issues using Previous. The VM hangs sometimes while moving the mouse and on high network traffic, so, still no usable NFS. Maybe some IRQ issue.

eukara

That is so awesome. I'll mess around with it this weekend if I find the time.
Doubt it'll have enough overhead leftover to run X11 and GNUstep, but that'd be incredible.

ramalhais

Quote from: eukara on October 26, 2022, 10:35:09 AMThat is so awesome. I'll mess around with it this weekend if I find the time.
Doubt it'll have enough overhead leftover to run X11 and GNUstep, but that'd be incredible.

I'm trying to make Xorg work. It starts, but all i get is a black screen and it seems to hang. It may just be the Previous emultator hanging. I have no NeXT hardware :(

EDIT: X is probably going to be slow because it's using fbdev.
I'm now trying to mess with SCSI/previous disk images, so that i don't have the limit of 16MB for the linux+initramfs to keep the files

I'll be glad to help if anyone needs some pointers. Either here or on github(preferably):
https://github.com/ramalhais/linux/discussions

eukara

How about XFree86? That should in theory still compile and run. It is used on some BSD systems because it's the only one still with some platform glue they need on some architectures I believe.

ramalhais

Quote from: eukara on November 04, 2022, 03:44:25 PMHow about XFree86? That should in theory still compile and run. It is used on some BSD systems because it's the only one still with some platform glue they need on some architectures I believe.

yep, old software is probably a good fallback since it's usually simpler and smaller, but i have good news: Xorg is running!

I can start xterm, but keyboard and mouse not working. Probably needs some tweaks to the xorg.conf file.

I still get freezes in Previous, even after stopping the ethernet interface (i was assuming it was something with the ethernet IRQs or DMA).

ramalhais

Good news! SCSI is working!
We can also detect nextstep disklabel partitions and mount nextstep partitions read-only.

ramalhais

So, i've been busy with a lot of stuff:

- UFS filesystem
Filesystems are hard  :'(  ... linux only supports readonly UFS for the version of UFS used on the NeXT.
Tried to enable write support and KABOOOM.

- NetBSD bootloader with support for ext2 (linux filesystem)
Got it booting in Previous, but only on turbo boards.
After some Previous patches from Andreas it now seems to work on non-turbos aswell.
It can boot an ext2 disk image.

- Creating bootable disk images
NeXT partition label support in linux.
Script to create disk images.
App to write a NeXT disklabel to the image/disk.

- X11/Window managers
Got X11 working with mouse and keyboard.
Still have a bug in Previous where if i have mouse grab enabled, no mouse input gets to linux.
Tried several window managers, but unfortunately most don't work including WindowMaker (NeXTStep lookalike which i really wanted).
I think i got TWM to work, but that's old as hell.
Also, latest X11 and latest window managers use so much memory (huge binaries) that it makes the NeXT slow as hell to load (well, in Previous, not tested on actual hardware yet).
I guess the framebuffer is going to be very slow unless i find a way to accelerate this, like DMA or something.

- Real Hardware:
I have received Rob's donation, a color nextstation 14MB with floppy, and a bare mono board, and been busy trying to get a screen, keyboard input and trying to fix networking that works on Previous but not on the real hardware.

For the screen i tried many things, including custom SCART(EURO-AV) cable, VGA to HDMI converters, nothing worked. I got a bit of image on an old samsung 32in TV via the custom scart cable, but it couldn't handle the sync on green.
In the end i got an old Samsung SyncMaster 710N which supports sync on green.
Works with both the mono and color stations. Still waiting for a 13w3 connector (expensive) and make a 19pin DB connector so that the connections are more reliable.

I got serial console working.
If you don't connect the RTS/CTS lines, you need to disable software flow control on the client (using putty) or you'll get garbled text after the PROM's serial test.
Also had issues with one of the serial to usb adapters CP2102 outputting only garbage.
Had success with an old serial to usb adapter: ATEN UC232A USB to RS-232 Adapter.

I bought some additional memory because it seems like it needs at least 20MB to boot the linux kernel.
Need to look into that. The kernel is only 6MB, it needs a bit to uncompress the initramfs, but it shouldn't be 20MB!
If you live in Europe and can't find reasonably priced 30pin memory, I recomend a guy in france that makes 30pin SIMMS from old 72pin SIMMS: https://www.ebay.es/itm/115420643997

I have also bought a battery for the mono and now both boards boot from the network.

I can get the mono station to a linux shell, but networking and scsi don't work, seems like some issue with accessing memory addresses on the BMAP chip.

The color station starts booting but then the color framebuffer doesn't work, probably related to the same issue with the network and scsi as on the mono.

Also tried to implement something on an ESP32 to implement the monitor (keyboard/mouse/sound) protocol, but i got nowhere, it seems like an ESP32 can't handle the high speed (5mhz?) of the protocol. I got an FPGA to play with and i'm waiting for a logic analyzer, but without a real soundcard, it's going to be tough.
I found the NeXT mouse of my lost nextstation mono, it was in some bag from the last house move.

Also tried to make a DIY SCSI2SD/BlueSCSI based on DietSCSI, but it didn't work (you're going to laugh at my attempt  :-[  ). Ordered some DietSCSI boards from JLCPCB. Basically for 75EUR you get 5 DietSCSI boards. I'll let you know how that went.

Tried to implement something in the linux kernel to overwrite the settings on NVRAM to enable serial console on the mono (it's back to the default settings because it had no battery and i have no soundcard/keyboard), it can write to the NVRAM, but i can't for the life of me get the checksum algorithm to give me a correct checksum, so when the NeXT boots, it resets to defaults again  :'(

I'll post pictures later.