Hi there,
I am currently developing an os for the beagleboard r4 and try to pass arguments to the user's applications main(). I tried to push some values to register R0, R1, R2, R3 but argc and argv are never set. I put the --args option to my app's linker script but still no success.
it seems that the __ti_auto_init() or __args_main() do not use my pushed values. where do I have to set them for my new user application?
thanks in advance and best regards,
matthias schmid
my application's .cmd file and the boot.asm file:
////////////////////////////////////////////////////////
//
// Linker command file for a Task for the Ottos-Kernel
//
-c
--args=1024
-stack 0x00002000
-heap 0x00002000
MEMORY
{
virtual_memory: ORIGIN 0x00020000 LENGTH = 0x01000000
stack_memory: ORIGIN 0x10000000 LENGTH = 0x00002000
sysmem_memory: ORIGIN 0x10002000 LENGTH = 0x00002000
}
SECTIONS
{
ORDER
.text > virtual_memory {
boot.obj
*(.text)
}
.bss > virtual_memory
.const > virtual_memory
.cinit > virtual_memory
.pinit > virtual_memory
.cio > virtual_memory
.switch > virtual_memory
.far > virtual_memory
.data > virtual_memory
.switch > virtual_memory
.init_array > virtual_memory
.stack > stack_memory {
systemStack = .;
}
.sysmem > sysmem_memory {
sysmem = .;
}
}
// ***************************
// boot.asm
;PUSH {A1-A4}
.armfunc _c_int00
.global _c_int00
;***************************************************************
;* TI includes
;***************************************************************
.asg __args_main, ARGS_MAIN_RTN
.global ARGS_MAIN_RTN
.global __TI_auto_init
;***************************************************************
;* Included addresses from the linker
;***************************************************************
.global systemStack
;***************************************************************
;* CONSTANTS USED BY THIS MODULE
;***************************************************************
c_r13_system .long systemStack
;***************************************************************
;* FUNCTION DEF: _c_int00
;***************************************************************
_c_int00: .asmfunc
; Perform all the required initilizations:
; - Process BINIT Table
; - Perform C auto initialization
; - Call global constructors)
BL __TI_auto_init
;POP {A1-A4}
; CALL APPLICATION
BL ARGS_MAIN_RTN
.end