Merge branch 'master' into prog-loader
authorMinep <lunaixsky@qq.com>
Wed, 14 Jun 2023 21:34:07 +0000 (22:34 +0100)
committerMinep <lunaixsky@qq.com>
Wed, 14 Jun 2023 21:34:07 +0000 (22:34 +0100)
README.md
lunaix-os/hal/ahci/utils.c
slides/c0-workspace/all-build.sh

index a9d1b66eb5b38eba7063d779bd83d9a4eea9b175..b8111ec62efaaafcb6479f0773c93335af58ffad 100644 (file)
--- 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命令:
index 4a86cc3fe2e3bf98dc8a43670f27eb0ce0ec789f..923f916d78e52f1ccf0113ca712132c2c321134c 100644 (file)
@@ -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;
     }
index 30c0e3e928806e448b64114a77fcc2421d716539..c1c2e2a8bb496a74fd897c94dd9032b1d13847c9 100755 (executable)
@@ -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"