修改代码格式

This commit is contained in:
zhangzheng
2022-12-16 20:39:29 +08:00
parent ac397f58f8
commit 86e82967ad

View File

@@ -9,28 +9,27 @@
#include <assert.h>
#include <mkrtos/fs.h>
#include <fcntl.h>
//内核
//内核功能进程管理内存管理带MPU进程间通信(一定要牛逼,用户态驱动要用到)
// 内核功能进程管理内存管理带MPU进程间通信(一定要牛逼,用户态驱动要用到)
//进程管理功能:
//1.调度器O(1),区分内核进程和用户进程。
//2.系统调用内核态msp指针用户态psp指针。
//3.明天搞mpuelf动态加载
//4.应用程序直接加载bin文件执行
void thread_main(void *arg0, void *arg1) {
// 进程管理功能:
// 1.调度器O(1),区分内核进程和用户进程。
// 2.系统调用内核态msp指针用户态psp指针。
// 3.明天搞mpuelf动态加载
// 4.应用程序直接加载bin文件执行
void thread_main(void *arg0, void *arg1)
{
int ret;
sys_tasks_info.is_run = TRUE;
mkrtos_test();
// #if 0
setup();
const char * const argv[] = {
"/bin/zh"
,0
};
sys_execve("/bin/zh",argv);
const char *const argv[] = {
"/bin/zh", 0};
sys_execve("/bin/zh", argv);
// #endif
kprint("done!\n");
while(1) {
while (1)
{
sleep_ms(1000);
}
}
@@ -41,22 +40,23 @@ void thread_main(void *arg0, void *arg1) {
// }
// }
#include <stm32f2xx.h>
int main(void) {
int main(void)
{
static struct task_create_par tcp;
int32_t pid;
extern int32_t bk_flash_init(void);
extern int32_t bk_flash_init(void);
__enable_irq();
// //TODO:增加栈8字节对齐
((uint8_t *)(0xE000E008))[0] |= 0x6;
// //TODO:关闭指令流水线?
// ((uint8_t *)(0xE000ED14))[0] |= 0x200;
//初始化默认的磁盘设备
// //TODO:增加栈8字节对齐
((uint8_t *)(0xE000E008))[0] |= 0x6;
// //TODO:关闭指令流水线?
// ((uint8_t *)(0xE000ED14))[0] |= 0x200;
// 初始化默认的磁盘设备
root_dev_no = bk_flash_init();
init_sche();
tcp.task_fun = thread_main;
tcp.arg0 = (void*) 0;
tcp.arg0 = (void *)0;
tcp.arg1 = 0;
tcp.prio = 6;
tcp.exec_id = -1;
@@ -71,4 +71,3 @@ int main(void) {
while (1)
;
}