Click Here
home features news forums classifieds faqs links search
5753 members 
Amiga Q&A /  Free for All /  Emulation /  Gaming / (Latest Posts)
Login

Nickname

Password

Lost Password?

Don't have an account yet?
Register now!

Support Amigaworld.net
Your support is needed and is appreciated as Amigaworld.net is primarily dependent upon the support of its users.
Donate

Menu
Main sections
Home
Features
News
Forums
Classifieds
Links
Downloads
Extras
OS4 Zone
IRC Network
AmigaWorld Radio
Newsfeed
Top Members
Amiga Dealers
Information
About Us
FAQs
Advertise
Polls
Terms of Service
Search

IRC Channel
Server: irc.amigaworld.net
Ports: 1024,5555, 6665-6669
SSL port: 6697
Channel: #Amigaworld
Channel Policy and Guidelines

Who's Online
63 crawler(s) on-line.
 19 guest(s) on-line.
 1 member(s) on-line.


 saimo

You are an anonymous user.
Register Now!
 saimo:  1 min ago
 evilFrog:  12 mins ago
 MEGA_RJ_MICAL:  13 mins ago
 BigD:  14 mins ago
 Lou:  15 mins ago
 CygnusEd:  25 mins ago
 DiskDoctor:  39 mins ago
 Hypex:  42 mins ago
 matthey:  56 mins ago
 _Steve_:  1 hr 14 mins ago

Features

Main »» Tutorials

Serial debug output on A1s for AOS4  Popular
(Read 4893 times)
by Wegster
wegster@mindcore.net

As I recently ran into a need for this, yet saw no definitive document or thread on it, I thought this might be useful information for someone else.

Things you'll need:
An AmigaOne
Another computer system (PC running Windows, Linux, *BSD, Mac, others)
A null modem cable
a terminal program
serial port breakout cable to DB9 if using a uA1-C

AmigaOS 4 is able to provide debug output over it's serial port, which can be helpful in tracking down or recording crash reports and provide useful information in booting or hardware problems as well.

The serial port on AmigaOnes is a standard 16550A port, and requires a null modem cable to another computer system. The serial ports on the AmigaOnes are of the male DB-9 variety, meaning they are 9 pin connectors. You will need a DB-9 female connector (9 'sockets' instead of pins to mate to the A1 serial port male/pins) on one end, and whatever connector needed for the system you're going to connect to. Nowadays, this is most likely another DB-9 male serial port.

NOTE: For uA1-C owners, a serial header exists, but is not wired to a DB-9. See the following for information on connecting a standard DB9 plug on your uA1-C:
Lyle Hazelwoods Building a uA1-C

Here is the null modem pinout for a DB-9 to DB-9 cable:

Null-Modem Pinouts
DB-9 to DB-9
1+6 to 4
2 to 3
3 to 2
4 to 1 and 6
5 to 5
7 to 8
8 to 7

Note that these cables are readily available at most computer stores, and can be tested with a continuity tester or ohmmeter if needed on an 'unknown' cable. You can also buy a null modem adapter to convert a straight serial cable to a null modem cable.

Connect one end of the cable to your first serial port on your A1. For the XE, the correct port is the serial port closest to the PS/2 and USB ports, towards the top of your tower.
NOTE: The SE and XE have two serial ports, and the uA1-C has a single port, but the uA1-C must be wired and does not have a DB9 onboard, see the link presented towards the top of this article for more information for uA1-C owners.

Connect the other end to the serial port on your other computer system.

You'll need a terminal program on your other system to read the data coming from your A1. For Windows, you can use HyperTerminal. For Linux and other Unix and unix like systems, you can use minicom, cu, or others.

NOTE: If you use minicom, and possibly other programs, you'll want to clear the modem initialization string and modem reset strings, as your A1 is NOT a modem.

Set your terminal program to connect to the correct serial port for your machine (usually COM1 for Windows, or ttyS0 for Linux), and set your communication parameters to 115200 bps, 8-N-1.

Minicom can be started by:
minicom ttyS0 where ttyS0 is replaced with the correct port you're connected to
and cu:
cu -d /dev/ttyS0

NOTE: cu is a bit cryptic, so see the mane page before using, most notably for the escape sequences to get out of the program!

You'll need to make sure that your A1 is set to the correct baudrate as your terminal program, so reboot or power on your A1, hit Enter and then escape, select preferences, ESC, then select Abort Boot and enter uBoot Shell to get a uBoot prompt. At the prompt, type:
printenv baudrate

and verify it's set to 115200. If not, type:
setenv baudrate 115200

While you're in uBoot, you'll also want to allow error messages to be directed to the serial port. Do this by typing:
setenv stdout serial

NOTE: You can always change this back to the default by typing:
setenv stdout vga

That will take effect even if you may not see your typing at the uBoot command line once you've activated stdout redirecting to serial. This means when you later go to reset your output back to your video card, you may not be able to read as you type, but it will still take effect!

Finally, type:
saveenv
reset

to save your uBoot environment variables to NVRAM (non volatile RAM) and reboot your system.

You may want to verify and troubleshoot your serial connection before going back into AOS. After your reboot, go back to the uBoot prompt, and you can type:
printenv
at the uBoot prompt once you've redirected to serial, and you should see a bunch of environment variables/uBoot settings displayed on your other computers terminal session.

If you do not see any output over the serial port, try the following:
a. Check you are connected to the right port on your A1.
b. Check port connected to on your PC/other system. Change your comm settings in your terminal program to use COM2, ttyS1, etc as appropriate and reboot the A1 and check output again.
c. Check your comm settings (baudrate and parity) on both the A1 via uBoot:
setenv stdout serial
setenv baudrate 115200
and in your communications terminal program.
d. Verify you have a null modem cable.

NOTE: If you get 'garbled' output to your terminal prgoram, it's most likely a baudrate or parity mismatch, but you ARE on the correct serial port.

Once you're getting some output to your terminal program, when your A1 is rebooted, you should see something similar to the following:
Quote:

U-Boot 1.1.1 (Dec 18 2004 - 11:59:30), Build: 12/18/04

CPU: MPC7455 v2.1 @ 933.333 MHz
Board: AmigaOne
DRAM: 512 MB
FLASH: 0 kB
VGA: 0 ..
In: serial
Out: serial
Err: serial
SCSI: Error SCSI Controller (1000,000F) not found
Net: 3Com 3c920c#0
IDE: Bus 0: OK Bus 1: OK
Device 0: Model: WDC WD800BB-00DKA0 Firm: 77.07W77 Ser#: WD-WMAHL1976172
Type: Hard Disk
Supports 48-bit addressing
Capacity: 76319.0 MB = 74.5 GB (156301488 x 512)
Device 1: not available
Device 2: Vendor: TSSTcor Prod.: CD/DVDW TS-H552 Rev: TS05
Type: Removable CD ROM
Capacity: not available
Device 3: Vendor: SAMSUNG Prod.: CD-R/RW SW-252B Rev: R701
Type: Removable CD ROM
Capacity: 231.2 MB = 0.2 GB (118381 x 2048)
AT Keyboard initialized!
USB: scanning bus for devices... 3 USB Devices found
No Catweasel controller (0xe1594, 0x0001) attached
Press any key to interrupt autoboot: 0
First-level bootloader: entered main
First-level bootloader: got 1 valid boot sources
Entered find_sec_bl_start
Reading sector 0
Reading sector 1
Found an HD
FLB: found something
FLB: SLB of length 28684; loading
FLB: SLB loaded; now launching it
Loading .text @ 0x014000a0 (23832 bytes)
Loading .rodata @ 0x01405db8 (2621 bytes)
Loading .data @ 0x014167f8 (208 bytes)
Loading .got2 @ 0x014168c8 (712 bytes)
Loading .sdata @ 0x01416b90 (16 bytes)
Clearing .sbss @ 0x01416ba0 (188 bytes)
Clearing .bss @ 0x01416c5c (3772 bytes)
A1 Second-level booter V2.
Idea, design and main code: Andrea Vallinotto.
Testing and fixes: Stefan Burstroem
SFS and ISO9660 reading routines: Joerg Strohmayer.
Linux booting extensions: Andrea and the GRUB team.
A1 Second-level booter V2.
Idea, design and main code: Andrea Vallinotto.
Testing and fixes: Stefan Burstroem
SFS and ISO9660 reading routines: Joerg Strohmayer.
Linux booting extensions: Andrea and the GRUB team.

Booting configuration Default
[libInit] returning 0x018B13B0
[SetupInterrupts] which = 1, intNum = 28 , IRQ = 12
[SetupInterrupts] which = 0, intNum = 17 , IRQ = 1

a1ide.device 51.43 (07.06.2005)
[dev_init] a1ide_maxbus : '2', adjusted max units to 4
[dev_init] Config forced in $a1ide_conf : 1220
[dev_init] Xfer modes forced in $a1ide_xfer : F000
[dev_init] Running on AmigaOne
[ide_list] IDE port 0 :
[ide_list] Master : 'ATA'
[ide_list] Slave : 'ATAPI'
[ide_list] IDE port 1 :
[ide_list] Master : 'ATAPI'
[ide_list] Slave : 'no device'
[init_unit] Trying to configure unit 0
[ata_read_drive_properties] Unit 0 is LBA48-capable but has LBA28 size
[ata_read_drive_properties] MultiCount 16
[ata_read_drive_properties] Adjusting unit 0 to xfer mode 69
[init_unit] Unit successfully configured, flags $0185
[init_unit] Trying to configure unit 1
[init_unit] Trying to configure unit 2
[ata_read_drive_properties] Adjusting unit 2 to xfer mode 12
[init_unit] Unit successfully configured, flags $011D
[init_unit] Trying to configure unit 3

sii0680ide.device 51.43 (07.06.2005)
[dev_init] Running on AmigaOne
[dev_init] PCI chip not found
[dev_init] Bailing out

sii3112ide.device 51.43 (07.06.2005)
[dev_init] Running on AmigaOne
[dev_init] PCI chip not found
[dev_init] Bailing out

sii3114ide.device 51.43 (07.06.2005)
[dev_init] Running on AmigaOne
[dev_init] PCI chip not found
[dev_init] Bailing out

sii3512ide.device 51.43 (07.06.2005)
[dev_init] Running on AmigaOne
[dev_init] PCI chip not found
[dev_init] Bailing out


If you are having problems with your video card, you may see something about 'card id not recognized' or messages about Radeon problems- in which case, there's a good chance you have an oddball video card and should replace it.

Debug Levels
Ok, so now you are getting serial output, but the default debug level is still set, which won't get you much debug output. It will however, dump Grim Reaper reports out over serial, so if your main concern is getting a copy of a GR report, that's all you need to do. Note that you can enable logging to file if you're using Minicom, and on some other terminal programs.

Debug levels for OS4 may also be enabled, which allow various levels of debugging.

I'm not sure what the 'highest' debug level is, but bear in mind, each increase in debuglevel will very likely make your system run more slowly, as additional code is being executed for enabling debug output.

Generally, level 1 gives you a bit, level 4 a lot, and level 10 a ridiculously large amount of debug output. IIRC, it will start to log function entry/exit at Level 16 or so, but that is really a leftover from the very early days, since that will be essentially unusable due to the amount of output it will produce.
NOTE: Thanks to Rogue/Hans-Joerg for supplying the above.

There are two ways to enable a debuglevel (the default level is 0):
a. via the uBoot boot options.
b. via AOS command line kdebug command

NOTE Need to fill in info here on how to add debug AOS boot if not already enabled.

IMPORTANT: Increasing your default debuglevel will cause your system to take longer to boot. This is normal!

To enable via uBoot, reboot or power on your A1, and hit any key exceptEnter when the kickstart loading starts, then select Boot Arguments for AmigaOS.
The default boot arguments will read along the lines of:
debuglevel=0
Change the value to whatever debuglevel you want to set and then boot the system. Note that changing it in this way is a one time boot at this debuglevel, unless you select 'save settings' instead 'of use settings for this session.'

Note that you must also select 'boot debug kernel' from your boot selection menu to get the debug output.

My preferred way to set the debuglevel however, is via the command line tool, kdebug. To use this, boot the debug kernel, and then open a shell, and type:
kdebug "debuglevel N" where N is the debuglevel you want to enable. Note there is no '=' sign in the command!

You can verify the above by booting the debug kernel, verifying you see the normal boot messages, then type:
[i]kdebug "debuglevel 6"
, open an app, and check your serial output- it should be writing out an acknowledgement of

the debuglevel setting:
Quote:

[cmd_debuglevel] Set debug level to 10

followed by some debug output like:
Quote:

[_impl_AllocSysObject] Creating system object 9
[_impl_AllocSysObject] Not tracked
[_impl_AllocSysObject] Calling constructor 0x01454DB0
[_impl_AllocSysObject] Result 0x13B401F8
[_util_CloneTagItems] Allocated 5 tag items at 0x13B401F8
[_impl_AllocSysObject] Creating system object 9
[_impl_AllocSysObject] Not tracked
[_impl_AllocSysObject] Calling constructor 0x01454DB0
[_impl_AllocSysObject] Result 0x13B401F8
[_util_CloneTagItems] Allocated 5 tag items at 0x13B401F8
[_impl_AllocSysObject] Creating system object 9
[_impl_AllocSysObject] Not tracked
[_impl_AllocSysObject] Calling constructor 0x01454DB0
[_impl_AllocSysObject] Result 0x13B401F8
[_util_CloneTagItems] Allocated 5 tag items at 0x13B401F8


Other Debug options
Some individual applications or components, like AHI, allow for setting their debug output seperately. In the case of AHI, this is via WorkBench/Prefs/AHI/Advanced Tab/DebugLevel.

These applications will generally write to serial if enabled, regardless of if you've booted from the OS4 debug kernel or not, as they are seperate from kernel space. If in doubt, though, refer to each application or individual component documentation where possible.

That about sums up serial output on your A1. I hope this article has been more helpful than confusing. If you find any problems or have questions on this article, please email me at wegster@mindcore.net.

References and Useful Links:
Lyle Hazelwoods Guide on Building a uA1-C (in particular the Serial Port section)
IntuitionBase- see the link to the 'uA1-C Handbook' - wegster
[ home ][ about us ][ privacy ] [ forums ][ classifieds ] [ links ][ news archive ] [ link to us ][ user account ]
Copyright (C) 2000 - 2019 Amigaworld.net.
Amigaworld.net was originally founded by David Doyle