The BIOS provided a simple ABI for disk (13h), video (10h), keyboard (16h), BASIC (18h), RTC (1Ah), serial (14h), and parallel (17h) ports. DOS added some abstractions, including filesystem, memory management, and some other generic I/O (mostly 21h). Sometimes third-party software extended it with things like mouse (33h) or network drivers, or programs like DESQview which provided some degree of fault tolerance and preemptive multitasking.
The balance between "when do things belong in your libc" or "when do things belong in your OS" has some wiggle room.
ados, an OS for NES
Moderator: Moderators
Re: ados, an OS for NES
There needs to be a way for games to abstract saved data. If anything, an operating system will incorporate a file system. On the NES, a file system would have to be tuned for NOR flash: any byte whose value is $FF can be rewritten, but a whole 4096 byte sector has to be erased back to $FF at once, and repeatedly erasing one sector will cause it to fail faster. This is commonly handled with a log-structured file system that treats the files as being in a circular buffer. New revisions of a file are appended to the head, and once the buffer is nearly full, any file whose newest revision is in the tail sector gets copied to the head sector so that the tail sector can be erased.Bregalad wrote:What is an OS for the NES of any use ? There's no need to recover from errors, and no need to abstract hardware details as a game engine revolves around them basically.