# # old_revision [7d33866401c2cf60b88be1b179f8dc873440ea8a] # # patch "memsize.c" # from [fddf3f15b53ae76a320f093455001dc9dbfa0b59] # to [05efbcaa20e34b1798beb59c3454393fde3643e1] # # patch "setup.S" # from [d1ca0daa77dad5ddd7ca12de88f4ed5c1599954b] # to [d7a3467c7535d5ed3b7ae881c943730cb8dc4470] # ============================================================ --- memsize.c fddf3f15b53ae76a320f093455001dc9dbfa0b59 +++ memsize.c 05efbcaa20e34b1798beb59c3454393fde3643e1 @@ -70,7 +70,14 @@ void mem_size(void) } /* Guarantee that pmap entries are in ascending order */ sort_pmap(); - v->plim_lower = 0; + + // intel mac hack - the 'bootcamp' bios emulation seems to include + // some specially-mapped pages in it's mem-map, so we don't want + // to include them. hopefully that'll stop the numlock led blinking + // and giving errors :) Bad luck if your bottom meg or so of + // memory is bunk. + v->plim_lower = 0x120000 >> 12; + v->plim_upper = v->pmap[v->msegs-1].end; adj_mem(); ============================================================ --- setup.S d1ca0daa77dad5ddd7ca12de88f4ed5c1599954b +++ setup.S d7a3467c7535d5ed3b7ae881c943730cb8dc4470 @@ -30,6 +30,34 @@ start: # that was painless, now we enable A20 +# start from grub-a20.patch + /* + * try to switch gateA20 using PORT92, the "Fast A20 and Init" + * register + */ + mov $0x92, %dx + inb %dx, %al + /* skip the port92 code if it's unimplemented (read returns 0xff) */ + cmpb $0xff, %al + jz alt_a20_done + + /* set or clear bit1, the ALT_A20_GATE bit */ + movb 4(%esp), %ah + testb %ah, %ah + jz alt_a20_cont1 + orb $2, %al + jmp alt_a20_cont2 +alt_a20_cont1: + and $0xfd, %al + + /* clear the INIT_NOW bit; don't accidently reset the machine */ +alt_a20_cont2: + and $0xfe, %al + outb %al, %dx + +alt_a20_done: +# end from grub-a20.patch + call empty_8042 movb $0xD1, %al # command write @@ -67,6 +95,9 @@ empty_8042: empty_8042: call delay inb $0x64, %al # 8042 status port + cmpb $0xff, %al # from grub-a20-patch, skip if not impl + jz empty_8042_ret + testb $1, %al # output buffer? jz no_output call delay @@ -76,6 +107,7 @@ no_output: no_output: testb $2, %al # is input buffer full? jnz empty_8042 # yes - loop +empty_8042_ret: ret # # Delay is needed after doing i/o