Permalink
Browse files

. 修正批处理文件不能加载 kernel、initrd。

  • Loading branch information...
yaya
yaya committed May 6, 2017
1 parent 46c03ce commit 32d31ba3e4067b53accdfcd12a40af7db22e7c87
Showing with 17 additions and 12 deletions.
  1. +5 −0 ChangeLog_chenall.txt
  2. +3 −3 stage2/asm.S
  3. +7 −7 stage2/boot.c
  4. +1 −2 stage2/cmdline.c
  5. +1 −0 stage2/shared.h
View
@@ -1,4 +1,9 @@
更新说明:
+2017-05-06(yaya)
+ 修正批处理文件不能加载 kernel、initrd。
+ 修正 mem64 不能正常工作。开放 mem64 函数。
+ 修正卷标显示。
+
2017-05-05(yaya)
改进卷标及UUID读写功能。(issue #138)
vol [--write] [DEVICE] [VOLUME]
View
@@ -14454,7 +14454,7 @@ VARIABLE(linux_data_real_addr)
.long 0
VARIABLE(linux_bzimage_tmp_addr)
- .long SYSTEM_RESERVED_MEMORY
+ .long LINUX_TMP_MEMORY
ENTRY(linux_boot)
@@ -14472,7 +14472,7 @@ ENTRY(linux_boot)
movl EXT_C(linux_text_len), %ecx
addl $3, %ecx
shrl $2, %ecx
- movl EXT_C(linux_bzimage_tmp_addr), %esi # SYSTEM_RESERVED_MEMORY
+ movl EXT_C(linux_bzimage_tmp_addr), %esi # LINUX_TMP_MEMORY
movl $LINUX_ZIMAGE_ADDR, %edi # 0x10000
rep movsl
@@ -14493,7 +14493,7 @@ ENTRY(big_linux_boot)
movl EXT_C(linux_text_len), %ecx
addl $3, %ecx
shrl $2, %ecx
- movl EXT_C(linux_bzimage_tmp_addr), %esi # SYSTEM_RESERVED_MEMORY
+ movl EXT_C(linux_bzimage_tmp_addr), %esi # LINUX_TMP_MEMORY
movl $LINUX_BZIMAGE_ADDR, %edi # 0x100000
rep movsl
View
@@ -645,7 +645,7 @@ load_image (char *kernel, char *arg, kernel_t suggested_type,
printf (", loadaddr=0x%x, text%s=0x%x", cur_addr, str, text_len);
/* we have to increase cur_addr for now... */
- cur_addr += SYSTEM_RESERVED_MEMORY; /* cur_addr is above SYSTEM_RESERVED_MEMORY. */
+ cur_addr += LINUX_TMP_MEMORY; /* cur_addr is above LINUX_TMP_MEMORY. */
/* read text, then read data */
if (grub_read ((unsigned long long) RAW_ADDR (cur_addr), text_len, 0xedde0d90) != text_len)
@@ -686,7 +686,7 @@ load_image (char *kernel, char *arg, kernel_t suggested_type,
if (align_4k)
cur_addr = (cur_addr + 0xFFF) & 0xFFFFF000;
- mbi.syms.a.addr = cur_addr - SYSTEM_RESERVED_MEMORY;
+ mbi.syms.a.addr = cur_addr - LINUX_TMP_MEMORY;
*((int *) RAW_ADDR (cur_addr)) = pu.aout->a_syms;
cur_addr += sizeof (int);
@@ -786,7 +786,7 @@ load_image (char *kernel, char *arg, kernel_t suggested_type,
if (! memcheck (memaddr, memsiz))
goto failure_newline;
- memaddr += SYSTEM_RESERVED_MEMORY;
+ memaddr += LINUX_TMP_MEMORY;
/* mark memory as used */
if (cur_addr < memaddr + memsiz)
@@ -819,7 +819,7 @@ load_image (char *kernel, char *arg, kernel_t suggested_type,
filepos = pu.elf->e_shoff;
if (grub_read ((unsigned long long) RAW_ADDR (cur_addr), tab_size, 0xedde0d90) == tab_size)
{
- mbi.syms.e.addr = cur_addr - SYSTEM_RESERVED_MEMORY;
+ mbi.syms.e.addr = cur_addr - LINUX_TMP_MEMORY;
shdr = (Elf32_Shdr *) mbi.syms.e.addr;
cur_addr += tab_size;
@@ -852,7 +852,7 @@ load_image (char *kernel, char *arg, kernel_t suggested_type,
break;
}
- shdr[i].sh_addr = cur_addr - SYSTEM_RESERVED_MEMORY;
+ shdr[i].sh_addr = cur_addr - LINUX_TMP_MEMORY;
cur_addr += sec_size;
}
}
@@ -939,9 +939,9 @@ load_module (char *module, char *arg)
mbi.mods_addr = 0x20000; /* yes, multi_boot() will move mll here. */
mll[mbi.mods_count].cmdline = (int) arg;
- mll[mbi.mods_count].mod_start = cur_addr - SYSTEM_RESERVED_MEMORY;
+ mll[mbi.mods_count].mod_start = cur_addr - LINUX_TMP_MEMORY;
cur_addr += len;
- mll[mbi.mods_count].mod_end = cur_addr - SYSTEM_RESERVED_MEMORY;
+ mll[mbi.mods_count].mod_end = cur_addr - LINUX_TMP_MEMORY;
mll[mbi.mods_count].pad = 0;
/* increment number of modules included */
View
@@ -228,8 +228,7 @@ static char *skip_to_next_cmd (char *cmd,int *status,int flags)
#define PRINTF_BUFFER ((unsigned char *)SYSTEM_RESERVED_MEMORY + 0x20000)
//char *pre_cmdline = (char *)0x4CB08;
-//static char *cmd_buffer = ((char *)SYSTEM_RESERVED_MEMORY - 0x10000);
-static char *cmd_buffer = ((char *)0x3A9000);
+static char *cmd_buffer = ((char *)SYSTEM_RESERVED_MEMORY - 0x10000);
int expand_var(const char *str,char *out,const unsigned int len_max)
{
View
@@ -48,6 +48,7 @@
*/
#define SYSTEM_RESERVED_MEMORY 0x2000000
+#define LINUX_TMP_MEMORY 0x2800000
/* unifont start at 24M */
#define UNIFONT_START 0x1800000

0 comments on commit 32d31ba

Please sign in to comment.