amiga-bootcamp/10_devices/serial.md
Ilia Sharin 21751c0025 docs(amiga): complete AmigaOS 3.1/3.2 developer reference — 172 files across 17 sections
Comprehensive technical documentation covering:
- Hardware: OCS/ECS/AGA custom chip registers, Copper & Blitter deep dives
- Boot sequence: cold boot through startup-sequence
- Binary format: HUNK executable spec, relocation, debug info
- Linking & ABI: .fd files, LVO tables, register calling conventions
- Exec kernel: tasks, interrupts, memory, signals, semaphores
- AmigaDOS: file I/O, FFS/OFS layout, CLI/Shell scripting
- Graphics: planar bitmaps, Copper programming, HAM/EHB modes
- Intuition: screens, windows, IDCMP, BOOPSI
- Devices: trackdisk, SCSI, serial, timer, audio, keyboard
- Libraries: utility, expansion, IFFParse, locale, ARexx
- Networking: bsdsocket API, SANA-II, TCP/IP stack comparison
- Toolchain: GCC, vasm/vlink, SAS/C, NDK, debugging
- Reverse engineering: IDA/Ghidra setup, compiler fingerprints, case studies
- CPU & MMU: 68040/060 emulation libs, PMMU, cache management
- Driver development: SANA-II, Picasso96/RTG, AHI audio

All files include breadcrumb navigation. No local paths or proprietary content.
2026-04-23 12:17:35 -04:00

1.2 KiB

← Home · Devices

serial.device — RS-232 Communication

Overview

serial.device provides buffered RS-232 serial I/O through the Amiga's built-in 8520 CIA UART (active-high active sense).


Opening

struct IOExtSer *ser = (struct IOExtSer *)
    CreateIORequest(port, sizeof(struct IOExtSer));
OpenDevice("serial.device", 0, (struct IORequest *)ser, 0);

Setting Parameters

ser->io_CtlChar   = SER_DEFAULT_CTLCHAR;
ser->io_RBufLen   = 4096;       /* read buffer size */
ser->io_Baud      = 9600;
ser->io_ReadLen   = 8;          /* data bits */
ser->io_WriteLen  = 8;
ser->io_StopBits  = 1;
ser->io_SerFlags  = SERF_XDISABLED; /* no XON/XOFF */
ser->IOSer.io_Command = SDCMD_SETPARAMS;
DoIO((struct IORequest *)ser);

Commands

Code Constant Description
2 CMD_READ Read bytes
3 CMD_WRITE Write bytes
5 CMD_CLEAR Clear buffers
8 CMD_FLUSH Abort pending requests
9 SDCMD_QUERY Get status (bytes in buffer, errors)
10 SDCMD_BREAK Send break signal
11 SDCMD_SETPARAMS Set baud/bits/parity/stop

References

  • NDK39: devices/serial.h
  • ADCD 2.1: serial.device autodocs