Skip to content

Commit

Permalink
Add note on DOS memory usage
Browse files Browse the repository at this point in the history
  • Loading branch information
csoren committed Aug 6, 2023
1 parent 271bef8 commit 90885fd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion f256/experiments.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ To load a program, place it on eg. the SD card, and run it from DOS by typing it
Arguments may be passed to the program by adding them after the program name. Included in the firmware download is a `hello` program. This may be placed on disk and run by typing `hello` at the DOS prompt. Additionally, arguments may be added and they will be printed by the program.

# Programming information
DOS uses the memory area $0000-$07FF. Parameters are also stored in this area, and they must be copied if the area is also used by the user program.

Kernel user programs comprise up to four banks of code, and may be placed in the area $2000-$9FFF. The program header provides information to DOS on where to load the program and its entry address.

The program will be called with DOS' MMU configuration as configured by the MicroKernel.
Expand All @@ -20,4 +22,4 @@ A program may exit back to DOS by issuing an RTS instruction. Additionally the c

Arguments are passed in the `ext` and `extlen` kernel arguments. This approach has been cleared with Jessie Oberreuter, the MicroKernel author, and is also suitable for passing arguments through the RunNamed and RunBlock kernel functions.

`ext` will contain an array of pointers, on for each argument given on the commandline. The first pointer is the program name itself. The list is terminated with a null pointer. `extlen` contains the length in bytes of the array, less the null pointer. For instance, if two parameters are passed, `extlen` will be 4. These strings should be copied into the programs memory if it takes over the machine.
`ext` will contain an array of pointers, on for each argument given on the commandline. The first pointer is the program name itself. The list is terminated with a null pointer. `extlen` contains the length in bytes of the array, less the null pointer. For instance, if two parameters are passed, `extlen` will be 4. These strings should be copied into the programs memory if it uses the area used by DOS for storage.

0 comments on commit 90885fd

Please sign in to comment.