PMON Application

A PMON application (also known as a client), is a program that has been compiled and then downloaded to the target board.

Client Memory Map

When the program to be downloaded (client) is linked, the .text, .data, and .bss sections are all placed one behind the other starting at 0x80020000 (except ATMizer-I). The heap grows upward from the end of the .bss section, and the stack grows down from the top of memory. This stack area is only used by the client. PMON uses a stack that is located inside its .bss section. Heap overflow is indicated when the heap pointer crosses the stack pointer.
	HIGH MEMORY       +---------------+
			  |               |
			  |   stack  |    |
			  |          v    |
			  |               |
			  +---------------+
			  |		  |
			  |          ^    |
			  |   heap   |    |
			  |		  |
			  +---------------+
			  |      bss      |
			  +---------------+
			  |      data     |
			  +---------------+
	LOW MEMORY	  |      text     |
			  +---------------+

PMON I/O operations

Downloaded client programs perform all their I/O via PMON (unless they access the DUART directly). Therefore if you write a program containing calls to printf. These references will be resolved by a stub of code in the module lib/crt1.s. This stub uses a vector table, that is located at 0x200 bytes from the start of the PMON PROM, to transfer control to PMON's printf function.

	========> hello.c <========
	main()
	{
	printf("Hello world!\n");
	}

	========> part of crt1.s <========
		.globl printf
		.ent printf
	printf:
		li	t0,TBLBASE+20
		lw	t0,(t0)
		j	t0
		.end printf
Where TBLBASE is 0xa0c00200 for the ATMizer, and 0xbfc00200 for all other processors.

The file crt1.s allows a client program to access a number of target-dependent services provided by the PROM Monitor. The linkage mechanism for all these services is the vector table.


Navigation: Document Home | Document Contents | Document Index