shithub: riscv

ref: b4eb667f02c32f007290b68adc95c8fbd9a2c3cd
dir: /acme/bin/source/acd/outline/

View raw version
acd is composed of four procs

wineventproc (win.c:/^wineventproc)
	reads acme window events, sends them along w->cevent.

cdstatusproc (mmc.c:/^cdstatusproc)
	reads cd status once per second, sending
		status updates to d->cstatus.
	detects disk changes, sends new tocs to d->ctocdisp.

cddbproc (cddb.c:/^cddbproc)
	reads tocs from d->cdbreq, if it finds
		translations in the cddb, sends new tocs to d->cdbreply.

eventwatcher (main.c:/^eventwatcher)
	the main event loop.
		reads status from d->cstatus.
		reads events from w->cevent.
		reads new tocs to display from d->ctocdisp.
		sends new tocs to translate to d->cdbreq.
		reads new translated tocs from d->cdbreply.

an interesting bug in the original design:
	both cdstatusproc and the eventwatcher proc
	issue scsi commands.  (the eventwatcher responds to
	things such as Play, Stop, etc., as well as advancing the track.)

	the sd(3) driver did not expect overlapped commands,
	and crashed.

	this has been fixed by making the scsi(2) commands threadsafe,
	and making the sd(3) driver more robust.