Thread: PDOS for Amiga
View Single Post
Old 04 March 2021, 03:33   #29
kerravon
Registered User
 
Join Date: Mar 2021
Location: Ligao, Free World North
Posts: 214
Quote:
Originally Posted by Docent View Post
Taking over the hardware can be done but it will significantly limit the possibility to use any of the additional devices or expansion cards - their drivers are offered as system devices and require AmigaOS to run. You'll be limited to default PAL/NTSC display, builtin keyboard, serial and floppy.
I'm happy to have just a handful of devices, but I do require a hard disk. I do want to distribute a hard disk image with all the GCC source code on it. Just the GCC executable itself takes up 3 MB, ie more than a floppy can handle.

Quote:
Additionally, bear in mind that Amiga hardware is more complex than most of its competitors. For example, the floppy controller is not a simple pc controller that only requires to specify track/sector number to read it. Its a DMA controller that reads the whole track in MFM format and you need to decode it yourself to read a sector.
Ok, thanks.

Quote:
Things like memory management, interrupt handling, task management, scheduling, libraries/devices handling need to be implemented with exact clones of all AmigaOS structures for compatibility.
Basically, you need to implement the whole microkernel functionality.
No, this is way out of my scope. There won't be any "tasks" at all. It will be a single-tasking OS. But yes, I do want to eventually run a "hello, world" Amiga hunk, after first getting a Pos*() ELF executable to work.

Quote:
In order to call a function in a library, you need to have an initialized library base. To get initialized library base, the library needs to be opened first.
There is one library (exec.library) that is always open and its LibraryBase is usually at $4 address. Exec.library contains functions to open/close other libraries and devices. So, to call a function from dos.library, first you need to call OpenLibrary from exec.library with "dos.library" as a name and 0 for any version. If this function succeeded, you'll get from it a pointer to DosBase. AmigaOS includes/pragmas resolve dos.library's Open call to a call relative to DosBase, so you need initialized DosBase first to perform any dos library function calls. This is also the case for any other library or device.
In an executable, generated assembly code is usually in the form of jsr -440(a6), where DosBase is first loaded in register a6 and -440 is a negative offset in jumptable, containing jump to address of called function in a library.
Ok, thanks. What I'd like to know is how DosBase is set by OpenLibrary. Is the Amiga hunk executable passed some pointer at startup, or does OpenLibrary() do an interrupt to retrieve the DosBase from AmigaOS?
kerravon is offline  
 
Page generated in 0.07814 seconds with 11 queries