• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

Output A/UX system console to serial port

robin-fo

Well-known member
Hi everyone,

I can log into an A/UX machine using the serial port. However, this only works when the system is fully booted. Is there any chance to read console messages during startup?
 

robin-fo

Well-known member
Brilliant! Although I expected a bit more output... (It's still not the same as if you would press the "messages" button during startup)
 

Attachments

  • Bildschirmfoto 2022-12-19 um 21.57.15.png
    Bildschirmfoto 2022-12-19 um 21.57.15.png
    2.9 MB · Views: 36
Last edited:

zefrenchtoon

Well-known member
My goal is to find out where a Performa 475 crashes during boot 🙂
Very interesting !! I will follow you quest ! :love:

I've read that the main problem is the lack of support of the 475 "graphic card". I thought about trying to get the linux driver to adapt it to A/UX ... but I'm sure that it is a silly idea and I do not have enough skills to do that o_O
 

cheesestraws

Well-known member
I had a look last night and there *is* serial console output code in the kernel for early boot. How to turn it on and whether it actually works is another matter...

My goal is to find out where a Performa 475 crashes during boot 🙂

Ooh, that would be useful to know.

I've read that the main problem is the lack of support of the 475 "graphic card".

I've also heard that. But having spent a little while digging around in the video section of the A/UX kernel for my VNC project, that seems a bit of an odd statement: there really aren't any video drivers in the A/UX kernel, it loads the Mac drivers out of the declrom and then does hairy things to make them work. So I think the story may be a little more subtle.
 

robin-fo

Well-known member
Actually, I‘d expect to be able to enable the serial console in the bootloader (as in Linux?), but I didn‘t find any hint in the official documentation…
 

cheesestraws

Well-known member
There seems to be a variable in the kernel which seems to control whether the output is sent to the serial port or not. It's set to 0 by default...

ed: it's not the variable I thought it was, it's a different one. I can't read :)
 
Last edited:

cheesestraws

Well-known member
Actually, I‘d expect to be able to enable the serial console in the bootloader (as in Linux?), but I didn‘t find any hint in the official documentation…

OK, this was a bit harder than I expected, but here, have a dodgy as all hell kernel module/patch that forces early boot output to go to serial (tar file attached to this post). You'll still need to do the syscon swap I mentioned above for later-stage boot messages.

The file attached is a .tar.zip, which is a bit silly, but is only to get around the fact that the forum won't let me upload a raw tar file. Just unzip it before transferring it over to the A/UX machine.

First of all, make sure that A/UX startup is set to verbose default boot (under Preferences -> Booting...) add '-v' to the launch command).

Then, to install, untar it, then

Code:
# cd kernel
# ./install.sh
# newconfig se

Assuming newconfig doesn't scream at you, then you should be able to reboot and get early output on the serial port. Note that those messages will no longer appear on the video console, because it's late and I'm tired and I can't be bothered to work out how to make it work on both.

Screenshot 2022-12-21 at 01.55.12.png
 

Attachments

  • se.tar.zip
    3.1 KB · Views: 3

cheesestraws

Well-known member
Now that I'm awake, how this works: I started by looking at the kernel's printf to see how it actually did the output. It calls a function called 'outchar' for each character, which calls two other functions, the first of which stuffs the character in the kernel buffer, the second of which—if verbose mode is enabled—actually does the output.

The output is done by calling through a global function pointer called locputchar. By default, this is wired into serial output. But when the video console mode driver loads (in the very early init phase), if any video devices exist, it swaps that over to the video console.

This module, following the traditional MacOS development practice of "finding other people's global data and messing around with it without permission", loads in early init (the pf flag in its master configuration file) after the console driver loads, and puts the serial output putchar back again, undoing the change.
 

Phipli

Well-known member
The output is done by calling through a global function pointer called locputchar. By default, this is wired into serial output. But when the video console mode driver loads (in the very early init phase), if any video devices exist, it swaps that over to the video console.
Does this mean you get full serial output if you unplug the monitor?
 

cheesestraws

Well-known member
Does this mean you get full serial output if you unplug the monitor?

If I'm reading the code correctly, yes, so long as the video card in question is doing the right thing. But please bear in mind I'm reading disassembled/decompiled code I don't fully understand, so this has a big asterisk after it.
 

Phipli

Well-known member
If I'm reading the code correctly, yes, so long as the video card in question is doing the right thing. But please bear in mind I'm reading disassembled/decompiled code I don't fully understand, so this has a big asterisk after it.
Yeah, not all cards report back "no monitor connected", but many do. Interesting.

Probably clashes with VNC objectives - not sure what the framebuffer does with no monitor. My 6500 seems to refuse to boot with no monitor attached.
 

robin-fo

Well-known member
Ok I tested it on the 475 and it appears to crash before there is any console output if I observed correctly...
 
Top