Jonathan Chan
Jonathan Chan

Reputation: 2399

How would an OS in MIPS access peripherals?

I've been reading about the MIPS assembly language for a while, just to learn. I get now that syscalls and exceptions in user code make the processor jump to a certain location in memory where the kernel and exception handled reside.

What I am curious about is how the OS can access peripherals, as I can't see any other relevant instructions. Does the processor export its own set of fundamental syscalls, or do the peripherals somehow get mapped to memory?

Upvotes: 2

Views: 540

Answers (1)

Variable Length Coder
Variable Length Coder

Reputation: 8116

MIPS does not have special IO instructions. Peripherals are mapped to the flat physical address space via some memory bus interface and then accessed using standard load/store instructions. MIPS does have coprocessor control instructions which could be used to manipulate some peripherals (primarily the MMU or cache controller), but these are not often used for general-purpose device interfaces.

Upvotes: 3

Related Questions