edid: Properly get segment:offset from flat address

This commit is contained in:
mintsuki 2021-03-20 13:07:28 +01:00
parent 2dc49ee73b
commit c89644b3d1
3 changed files with 7 additions and 5 deletions

View File

@ -17,7 +17,9 @@ struct edid_info_struct *get_edid_info(void) {
r.eax = 0x4f15;
r.ebx = 0x0001;
r.edi = (uint32_t)buf;
r.edi = (uint32_t)rm_off(buf);
r.ds = (uint32_t)rm_seg(buf);
r.es = r.ds;
rm_int(0x10, &r, &r);
if ((r.eax & 0x00ff) != 0x4f)

View File

@ -164,10 +164,10 @@ bool init_gop(struct fb_info *ret,
target_bpp = 32;
print("gop: EDID detected screen resolution of %ux%u\n",
target_width, target_height);
goto retry;
}
} else {
goto fallback;
}
goto fallback;
} else {
print("gop: Requested resolution of %ux%ux%u\n",
target_width, target_height, target_bpp);

View File

@ -152,10 +152,10 @@ bool init_vbe(struct fb_info *ret,
target_bpp = 32;
print("vbe: EDID detected screen resolution of %ux%u\n",
target_width, target_height);
goto retry;
}
} else {
goto fallback;
}
goto fallback;
} else {
print("vbe: Requested resolution of %ux%ux%u\n",
target_width, target_height, target_bpp);