onix
onix copied to clipboard
Onix - 操作系统实现
https://github.com/StevenBaby/onix/blob/748013c6ace822c0034c95291c41e0033f24c1bd/src/include/onix/types.h#L28 1、应该使用 typedef signed char int8; 因为 char 的符号类型标准未明确,取决于编译器实现。 2、如何判断出 int 就是 int32 而 long long 就是 int64,之前看有 LP32、LP64这些,如果自己写话要如何精确定义。 ref: https://zh.cppreference.com/w/cpp/language/types https://www.ibm.com/docs/en/zos/2.1.0?topic=options-lp64-ilp32
这个宏可以直接使用 GCC 提供的 offset 宏来替代,Linux 目前也是也是采用 GCC 的这个宏来实现 container_of
console.c文件 static _inline void state_esc(console_t *con, char ch) 是否考虑在最开始添加con->state = STATE_NOR; 将状态设置为STATE_NOR状态