修复mac上cpio打包问题

This commit is contained in:
zhangzheng
2023-12-15 23:15:33 +08:00
parent bce83c3682
commit 6f3827a866
5 changed files with 19 additions and 15 deletions

6
.vscode/launch.json vendored
View File

@@ -45,9 +45,9 @@
"environment": [],
"externalConsole": false,
// "miDebuggerPath": "/opt/homebrew/bin/arm-none-eabi-gdb",
// "miDebuggerPath": "/Users/zhangzheng/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-gdb",
"miDebuggerPath": "/home/zhangzheng/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-gdb",
"miDebuggerServerAddress": "127.0.0.1:33333",
"miDebuggerPath": "/Users/zhangzheng/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-gdb",
// "miDebuggerPath": "/home/zhangzheng/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-gdb",
"miDebuggerServerAddress": "127.0.0.1:3333",
"MIMode": "gdb",
"setupCommands": [
{

View File

@@ -5,7 +5,7 @@ add_custom_target(
COMMAND
cd ${CMAKE_SOURCE_DIR}/build/output/cpio
COMMAND
find ./ -print | cpio -H newc -o > ${CMAKE_SOURCE_DIR}/build/output/rootfs.cpio
ls | cpio -H newc -o > ${CMAKE_SOURCE_DIR}/build/output/rootfs.cpio
COMMAND
srec_cat -output ${CMAKE_SOURCE_DIR}/build/output/kernel.img -binary
${CMAKE_SOURCE_DIR}/build/output/bootstrap -binary -offset 0x0

View File

@@ -8,7 +8,7 @@ export KEN_OFFSET=0x2000
export INIT_OFFSET=0x10000
export BOOTFS_ADDR_OFFSET=0x21000
export KNL_DATA=0x20000000
export KNL_DATA_SIZE=32M
export KNL_DATA_SIZE=10M
export BOARD=STM32F2x
export ARCH=cortex-m3
export PYTHON_EXECUTABLE=python3

View File

@@ -66,11 +66,10 @@ int cpio_find_next(umword_t st, const char *pre_name,
int name_size = htoi(file_info->c_namesize, 8);
mode = htoi(file_info->c_mode, 8);
const char *f_name = (char *)(i + sizeof(cpio_fs_t));
if (strcmp("TRAILER!!", f_name) == 0)
if (strcmp("TRAILER!!!", f_name) == 0)
{
return -1;
}
if (strncmp(f_name, pre_name, strlen(pre_name)) == 0)
{
if (S_ISDIR(mode))
@@ -117,7 +116,6 @@ int cpio_find_file(umword_t st, umword_t en, const char *name, umword_t *size, i
int name_size = htoi(file_info->c_namesize, 8);
mode = htoi(file_info->c_mode, 8);
const char *f_name = (char *)(i + sizeof(cpio_fs_t));
// printf("%s\n", f_name);
if (name[0] == '\0')
{
if (type)

View File

@@ -63,13 +63,19 @@ msg_tag_t thread_ipc_reply(msg_tag_t in_tag, ipc_timeout_t timeout);
msg_tag_t thread_ipc_send(msg_tag_t in_tag, obj_handler_t target_th_obj, ipc_timeout_t timeout);
msg_tag_t thread_ipc_call(msg_tag_t in_tag, obj_handler_t target_th_obj, ipc_timeout_t timeout);
#define thread_get_cur_ipc_msg() \
( \
{ \
umword_t buf; \
thread_msg_buf_get(-1, &buf, NULL); \
((ipc_msg_t *)buf); \
})
// #define thread_get_cur_ipc_msg() \
// ( \
// { \
// umword_t buf; \
// thread_msg_buf_get(-1, &buf, NULL); \
// ((ipc_msg_t *)buf); \
// })
static inline ipc_msg_t *thread_get_cur_ipc_msg(void)
{
umword_t buf;
thread_msg_buf_get(-1, &buf, NULL);
return (ipc_msg_t *)buf;
}
#define thread_get_src_pid() thread_get_cur_ipc_msg()->user[2]
#define thread_set_src_pid(pid) thread_get_cur_ipc_msg()->user[2] = pid