From: Minep Date: Wed, 14 Jun 2023 21:34:07 +0000 (+0100) Subject: Merge branch 'master' into prog-loader X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/commitdiff_plain/8c6f505faaa66e18cdca108dca549d4ad806a077?hp=0eabc11fcf240415e39f3873dfce7cd9384b3042 Merge branch 'master' into prog-loader --- diff --git a/README.md b/README.md index a9d1b66..b8111ec 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,8 @@ LunaixOS - 一个简单的,详细的,POSIX兼容的(但愿!),带有 ## 编译与构建 +### 环境搭建 + 构建该项目需要满足以下条件: + gcc (目标平台: i686-elf) @@ -63,6 +65,12 @@ LunaixOS - 一个简单的,详细的,POSIX兼容的(但愿!),带有 **注意:gcc不能是本机自带的,必须要从源码编译,并配置目标平台为:`i686-elf`,以进行交叉编译。配置过程可参考[附录二:编译gcc作为交叉编译器](#appendix2)。** +### Docker镜像 + +对于开发环境,本项目也提供了Docker镜像封装。开箱即用,无需配置,非常适合懒人或惜时者。详细使用方法请转到:[Lunaix OSDK项目](https://github.com/Minep/os-devkit)。 + +### 构建选项 + 假若条件满足,那么可以直接执行`make all`进行构建,完成后可在生成的`build`目录下找到可引导的iso。 本项目支持的make命令: diff --git a/lunaix-os/hal/ahci/utils.c b/lunaix-os/hal/ahci/utils.c index 4a86cc3..923f916 100644 --- a/lunaix-os/hal/ahci/utils.c +++ b/lunaix-os/hal/ahci/utils.c @@ -13,6 +13,7 @@ #define IDDEV_OFFSERIALNUM 10 #define IDDEV_OFFMODELNUM 27 #define IDDEV_OFFADDSUPPORT 69 +#define IDDEV_OFFA48SUPPORT 83 #define IDDEV_OFFALIGN 209 #define IDDEV_OFFLPP 106 #define IDDEV_OFFCAPABILITIES 49 @@ -34,7 +35,8 @@ ahci_parse_dev_info(struct hba_device* dev_info, uint16_t* data) dev_info->block_size = 512; } - if ((*(data + IDDEV_OFFADDSUPPORT) & 0x8)) { + if ((*(data + IDDEV_OFFADDSUPPORT) & 0x8) && + (*(data + IDDEV_OFFA48SUPPORT) & 0x400)) { dev_info->max_lba = *((uint64_t*)(data + IDDEV_OFFMAXLBA_EXT)); dev_info->flags |= HBA_DEV_FEXTLBA; } diff --git a/slides/c0-workspace/all-build.sh b/slides/c0-workspace/all-build.sh index 30c0e3e..c1c2e2a 100755 --- a/slides/c0-workspace/all-build.sh +++ b/slides/c0-workspace/all-build.sh @@ -108,8 +108,8 @@ if [[ $1 = "-d" ]] || [[ $1 = "--download" ]] || [[ ! -d "$shell_folder"/tools ] exit 255 fi echo 'Downloading cross-compiler...' - purple "=> gcc-10.4" - if wget -T 5 -c --quiet --show-progress -P "$shell_folder"/tools/src https://ftp.gnu.org/gnu/gcc/gcc-10.4.0/gcc-10.4.0.tar.gz; then + purple "=> gcc-12.2.0" + if wget -T 5 -c --quiet --show-progress -P "$shell_folder"/tools/src https://ftp.gnu.org/gnu/gcc/gcc-12.2.0/gcc-12.2.0.tar.gz; then green "gcc download success" else red 'gcc download fail, exiting... Re-run `bash init.sh -d` to continue gcc download' @@ -249,8 +249,8 @@ if [[ $1 = "-c" ]] || [[ $1 = "--compile" ]] || [[ $1 = "-fc" ]] || [[ $1 = '--f green "Compile options: $binutils_configure" echo "Extracting..." sleep 3s - if ! (tar xzf "$shell_folder"/tools/src/gcc-10.4.0.tar.gz); then - red "extract gcc-10.4.0.tar.gz fail, exiting..." + if ! (tar xzf "$shell_folder"/tools/src/gcc-12.2.0.tar.gz); then + red "extract gcc-12.2.0.tar.gz fail, exiting..." exit 255 fi if ! (mkdir -p build-gcc); then @@ -258,24 +258,24 @@ if [[ $1 = "-c" ]] || [[ $1 = "--compile" ]] || [[ $1 = "-fc" ]] || [[ $1 = '--f exit 255 fi cd "$shell_folder"/tools/src/build-gcc || (red 'cd to build-gcc fail' ;exit) - if ! (../gcc-10.4.0/configure --target=$TARGET --prefix="$PREFIX" $gcc_configure 2>&1 | tee "$log"/gcc-configure.log); then - red "gcc-10.4.0 configure fail, exiting..." + if ! (../gcc-12.2.0/configure --target=$TARGET --prefix="$PREFIX" $gcc_configure 2>&1 | tee "$log"/gcc-configure.log); then + red "gcc-12.2.0 configure fail, exiting..." exit 255 fi if ! (make -j "$(nproc)" all-gcc 2>&1 | tee "$log"/gcc-make-all-gcc.log); then - red "gcc-10.4.0 all-gcc make fail, exiting..." + red "gcc-12.2.0 all-gcc make fail, exiting..." exit 255 fi if ! (make -j "$(nproc)" all-target-libgcc 2>&1 | tee "$log"/gcc-make-all-target-libgcc.log); then - red "gcc-10.4.0 all-target-libgcc make fail, exiting..." + red "gcc-12.2.0 all-target-libgcc make fail, exiting..." exit 255 fi if ! (make install-gcc 2>&1 | tee "$log"/gcc-make-install-gcc.log); then - red "gcc-10.4.0 all-gcc make install fail, exiting..." + red "gcc-12.2.0 all-gcc make install fail, exiting..." exit 255 - fi + fi if ! (make install-target-libgcc 2>&1 | tee "$log"/gcc-make-install-target-libgcc.log); then - red "gcc-10.4.0 all-target-libgcc make install fail, exiting..." + red "gcc-12.2.0 all-target-libgcc make install fail, exiting..." exit 255 fi green "gcc successfully compiled and installed"