Saturday, October 24, 2009

Much better progress

Had a much better session today. I implemented the symbol debugger and began work on the BIOS SWI routines. The symbol debugger was easy to finish off, and it's very useful already.

The SWI routines are an interesting batch. They are basically like what system calls are to an operating system. The average system has two modes of operation: user mode and kernel mode, which is also known as privileged mode. User mode is where your programs run, and privileged mode is where the operating system runs. Whenever your program wants to run an operation that the operating system can do; such as open a file, it makes a system call which passes control to the operating system, which then does its work.

The SWI's function in the same way; they are routines provided by the BIOS that do things such as divide (as the ARM has no native divide instruction) or wait for a vertical blank interrupt. Implementing them all is essential, but by their names, they are quite detailed.

Also, for some random reason, if you do an SWI through ARM code, you have to specify the number in the upper 16-bits of the expression, like:

SWI 0x00010000: Perform operation 1

Not quite sure why this is, but it was in one of the DS manuals I've been reading.

No comments:

Post a Comment