GOAL: Implement Autosar OS scalability Class 1 Limitations: Only extended error checking is used (Scalbility class 3 and 4) Ongoing: - Autostart of tasks does not work - Bugs: - OsIsrResourceRef ? APIs for the OS: Os.h - External API for OS internal.h - Internal Kernel ONLY. kernel.h - Types shared between kernel and config Do we really want to have Os_Cfg.h when compiling the kernel? os_config_macros.h os_config_funcs.h Add file: os_config_if.h (used only by the kernel) extern int Oil_GetResourceCnt(); OsCfg_GetResourceCnt() internal.h OsStack_IsEndMarkOk() kernel.h types that are not in it's own header file. =========== OLD =========== Urgent: Problems with paths and stuff: - New project - File->New->C Project->Makefile Project->Empty project - Do NOT select any toolchain. - SELECT the project location where the project is and name it. - Project->Properties - Add to environment CROSS_COMPILE: /cygdrive/c/devtools/gcc/4.1.2/powerpc-eabispe/bin/powerpc-eabispe- PATH c:\cygwin\bin BDIR system/kernel MAC specific: CROSS_COMPILE=/opt/powerpc-eabi/bin/powerpc-eabi- Known problems: - Problems clicking on cygwin paths. Hmm can change rules to something like: $(subst /cygdrive/c/,c:/,$<) - I thought this worked before.... Next thing todo - resource - trusted functions COMPLETE IT!!!! ( The os is trusted and have their own indexes.. "OSServiceID_...." ) - ISR 2 !!! - trusted functions COMPLETE IT!!!! - protection hook - Stack check( for LC context ) - Seperate the ROM setup for pcb etc. in Oil_Config.c ( must have rom_pcb_t ?? ) ( Remove pcb.h from Oil_config.c/.h ) - Lots and lots of critical sections out there. PROTECT THEM!!! - DeclareResource() declares ok, DeclareTask() does not.. remove lists?? Conformance classes: - For OSEK, ECC2 ( See chap. 3.2 in OSEK spec ) - For Autosar( Scalability class, chap. 7.8 Autosar SWS OS ) Class 3-4 would be best.... Maybe: - Change type from xxx_t to xxxType as Autosar ??? ( remove own types.. ) DONE! - TRAP_PROGRAM() defines in cpu.h ongoing... - dbg printf.. so that we can use the T32 'term' window... - Implement the trap interface, see k_arch_..IVOR6 for more info. - Hooks - Stack check for SC context - basic tasks...ActivateTask, TerminateTask, ChainTask, Schedule What it can do: - SetEvent, WaitEvent, ClearEvent seems to work - the decrementer interrupt also seems to work ok. Repository: //balder/svn_tree/autosar Preparations: * You must have the path to cygwin stuff in path * You must install GCC at C:\devtools\gcc, version 4.1.2 is assumed ( you can of course change this in the makefiles ) Building: From cygwin prompt Test system >make BDIR=kernel,kernel/test ARCH=ppc55xx all Example, simple >make BDIR=kernel,examples/simple ARCH=ppc55xx all Installing >make BDIR=kernel,examples/simple ARCH=ppc55xx all install Software used: T32 T32 instruction simulator, www.lauterbach.com -> demo download(right menu) -> press "download" on second row of text -> save "Simulator for PowerPC" or find the one I used on //breidablick/Our Software/T32_simppc_20070322.zip Eclipse Platform 3.2.0 CDT 4.0.0 M6 Debugging: 1. when debugger started 2. >cd 3. >cd scripts 4. >do start [5.] >do lay // for some windows.. that are good. File structure: ------------------------------------------------------- kernel/ext_config.h Declaration of functions and variables in from config( Oil_Config.c ) include/Common_Cfg.h Shared types between config and os. ( generated later ?? ) Oil_Config.c Generated by OIL tool. Compiled by user Oil_Config.h Generated by OIL tool. Included by user. Service ------------------------------------------------------- ActivateTask 80 TerminateTask 80 ChainTask 80 Schedule 80 GetTaskID 100 GetTaskState 80 DisableAllInterrupts 100 EnableAllInterrupts 100 SuspendAllInterrupts 20 ResumeAllInterrupts 20 SuspendOSInterrupts 20 ResumeOSInterrupts 20 GetResource 100 ReleaseResource 50 SetEvent 100 ClearEvent 100 GetEvent 100 WaitEvent 100 GetAlarmBase 80 GetAlarm 80 SetRelAlarm 100 SetAbsAlarm 0 CancelAlarm 100 GetActiveApplicationMode 0 StartOS 50 ShutdownOS 50 GetApplicationID 0 GetISRID 0 CallTrustedFunction 50 CheckISRMemoryAccess 0 CheckTaskMemoryAccess 0 CheckObjectAccess 0 CheckObjectOwnership 0 StartScheduleTableRel 50 StartScheduleTableAbs 0 StopScheduleTable 0 NextScheduleTable 0 SyncScheduleTable 0 GetScheduleTableStatus 0 SetScheduleTableAsync 0 IncrementCounter 100 TerminateApplication 0 DisableInterruptSource 0 EnableInterruptSource 0 Kod: ------------------------------------------------ Adding a new architecture and board: 1. Add the configuration for the board in the top makefile. See the XXXX_config rules 2. Add the new board directory under /boards 3. Create the config.h file 4. If it's a new architecture create the directory under /arch. If it's an variant to an existing one. #ifdef'ing the code should be enough See if it works: 1. > make XXX_config 2. Check that a valid "boards//config.mk" was created Vilken core: CFG_E200Z? Vilken CPU: CFG_MPC5567 Vilken board: CFG_BRD_MPC5567?? * Om man ska anvŠnda SPE'n sŒ mŒste man lŠgga till CFG_MPC5567 till asm_book_e.h (detta fšrutsŠtter att man ocksŒ anvŠnder spe varianten av kompilatorn (powerpc-eabispe- istŠllet fšr powerpc-eabi-)) * Har sŠkert en MMU sŒ ni mŒste sŠtta upp den med. LŠgg denna under /arch/ppc/mm/blaj.c dŒ den sŠkert kommer att gŒ att anvŠnda till andra powerpc arch's. Header filerna lŠgger ni under /include/ppc CM: ------------------------------------------------ * Skapa en branch under aos-crew repot. Typ: mpc5567 (jag fyller aos-crew repot under kvŠllen) * NŠr den Šr klar gšr ni en merge mot trunk. * Jag lyfter den sedan till aos repot. boards |--- mpc5516it | |--- config | | |--- Gpt_Cfg.c/h <-- default config | | |--- Dio_Cfg.c/.h | | |--- mcu_aconfig.h | |--- examples | |--- simple | | |--- config | | | |--- Gpt_Cfg.c/h <-- if exist, overrides default config | | | |--- board_aconfig.h So, in this case it would take the default config for Dio and the example config for Gpt. Component more likely to find under boards: - Mcu - Can ... More likely under examples: - Gpt - Com ... Weak config targets: Mcu_Cfg.o Strong config targets: Gpt_Cfg.o Com_Cfg.o make BOARDDIR=boards/mpc5516it all