Skip to content

Commit

Permalink
. 修正color函数(issues #206)。
Browse files Browse the repository at this point in the history
  • Loading branch information
yaya committed Jul 30, 2019
1 parent 83673a9 commit 9fc74ea
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 28 deletions.
26 changes: 17 additions & 9 deletions stage2/asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,11 @@ bootup_a20_failure:
movl $0x37, %ecx
divl %ecx
movw %ax, ABS(EXT_C(count_ms))

xorb %bh, %bh
movb $0, %bl
movw $0x1003, %ax
int $0x10

/* transition to protected mode */
call EXT_C(real_to_prot)
Expand Down Expand Up @@ -17062,8 +17067,8 @@ VARIABLE(grub_putchar)
#define next_partition_partition ((*(unsigned long ***)0x8304)[2])
#define next_partition_type ((*(unsigned long ***)0x8304)[3])
#define next_partition_start ((*(unsigned long long ***)0x8304)[4])
#define next_partition_len ((*(unsigned long long ***)0x8304)[11])
#define next_partition_offset ((*(unsigned long long ***)0x8304)[14])
#define next_partition_len ((*(unsigned long long ***)0x8304)[5])
#define next_partition_offset ((*(unsigned long long ***)0x8304)[6])
#define next_partition_entry ((*(unsigned long ***)0x8304)[7])
#define next_partition_ext_offset ((*(unsigned long ***)0x8304)[8])
#define next_partition_buf ((*(char ***)0x8304)[9])
Expand All @@ -17082,8 +17087,9 @@ VARIABLE(next_partition_type)
.long 0
VARIABLE(next_partition_start)
.long 0
VARIABLE(next_partition_len)
.long 0
//VARIABLE(next_partition_offset)
VARIABLE(next_partition_offset)
.long 0
VARIABLE(next_partition_entry)
.long 0
Expand All @@ -17093,14 +17099,16 @@ VARIABLE(next_partition_buf)
.long 0
VARIABLE(quit_print)
.long 0
VARIABLE(next_partition_len)
.long 0
.long 0
//VARIABLE(buf_drive)
.long -1 //reserved
//VARIABLE(buf_track)
.long -1 //reserved
VARIABLE(filesystem_type)
.long 0
VARIABLE(next_partition_offset)
.long 0
.long 0
//VARIABLE(query_block_entries)//reserved
.long 0 //reserved
//VARIABLE(map_start_sector)//reserved
.long 0 //reserved
.long ABS(EXT_C(buf_geom))
.long ABS(EXT_C(tmp_geom))
.long ABS(EXT_C(term_table))
Expand Down
30 changes: 15 additions & 15 deletions stage2/builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -5641,9 +5641,9 @@ set_partition_hidden_flag (int hidden)
next_partition_dest = current_partition,
next_partition_partition = &part,
next_partition_type = &type,
next_partition_start = (unsigned long long *)(void *)&start,
next_partition_len = (unsigned long long *)(void *)&len,
next_partition_offset = (unsigned long long *)(void *)&offset,
next_partition_start = &start,
next_partition_len = &len,
next_partition_offset = &offset,
next_partition_entry = &entry1,
next_partition_ext_offset = &ext_offset1,
next_partition_buf = mbr,
Expand Down Expand Up @@ -5969,9 +5969,9 @@ find_func (char *arg, int flags)
next_partition_dest = 0xFFFFFF,
next_partition_partition = &part,
next_partition_type = &type,
next_partition_start = (unsigned long long *)(void *)&start,
next_partition_len = (unsigned long long *)(void *)&len,
next_partition_offset = (unsigned long long *)(void *)&offset,
next_partition_start = &start,
next_partition_len = &len,
next_partition_offset = &offset,
next_partition_entry = &entry1,
next_partition_ext_offset = &ext_offset1,
next_partition_buf = mbr,
Expand Down Expand Up @@ -6848,9 +6848,9 @@ uuid_func (char *argument, int flags)
next_partition_dest = 0xFFFFFF,
next_partition_partition = &part,
next_partition_type = &type,
next_partition_start = (unsigned long long *)(void *)&start,
next_partition_len = (unsigned long long *)(void *)&len,
next_partition_offset = (unsigned long long *)(void *)&offset,
next_partition_start = &start,
next_partition_len = &len,
next_partition_offset = &offset,
next_partition_entry = &entry1,
next_partition_ext_offset = &ext_offset1,
next_partition_buf = mbr,
Expand Down Expand Up @@ -12043,9 +12043,9 @@ parttype_func (char *arg, int flags)
next_partition_dest = current_partition,
next_partition_partition = &part,
next_partition_type = &type,
next_partition_start = (unsigned long long *)(void *)&start,
next_partition_len = (unsigned long long *)(void *)&len,
next_partition_offset = (unsigned long long *)(void *)&offset,
next_partition_start = &start,
next_partition_len = &len,
next_partition_offset = &offset,
next_partition_entry = &entry1,
next_partition_ext_offset = &ext_offset1,
next_partition_buf = mbr,
Expand Down Expand Up @@ -13084,9 +13084,9 @@ real_root_func (char *arg, int attempt_mnt)
next_partition_dest = 0xFFFFFF,
next_partition_partition = &part,
next_partition_type = &type,
next_partition_start = (unsigned long long *)(void *)&start,
next_partition_len = (unsigned long long *)(void *)&len,
next_partition_offset = (unsigned long long *)(void *)&offset,
next_partition_start = &start,
next_partition_len = &len,
next_partition_offset = &offset,
next_partition_entry = &entry1,
next_partition_ext_offset = &ext_offset1,
next_partition_buf = mbr,
Expand Down
8 changes: 4 additions & 4 deletions stage2/disk_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ next_pc_slice (void)

{
unsigned long long tmp_start = (unsigned long long)(unsigned long)(PC_SLICE_START (next_partition_buf, *next_partition_entry));
unsigned long long tmp_offset = (unsigned long long)(unsigned long)(*next_partition_offset);
unsigned long long tmp_offset = *next_partition_offset;
tmp_start += tmp_offset;
*next_partition_start = tmp_start;
*next_partition_type = PC_SLICE_TYPE (next_partition_buf, *next_partition_entry);
Expand Down Expand Up @@ -1117,9 +1117,9 @@ next_part (void)
next_partition_dest = dest_partition;
next_partition_partition = &current_partition;
next_partition_type = &current_slice;
next_partition_start = (unsigned long long *)(void *)&part_start;
next_partition_len = (unsigned long long *)(void *)&part_length;
next_partition_offset = (unsigned long long *)(void *)&part_offset;
next_partition_start = &part_start;
next_partition_len = &part_length;
next_partition_offset = &part_offset;
next_partition_entry = &entry;
next_partition_ext_offset = &ext_offset;
next_partition_buf = mbr;
Expand Down

0 comments on commit 9fc74ea

Please sign in to comment.