🐛 解决了帧缓冲区大小计算错误的问题

This commit is contained in:
fslongjin 2022-03-02 18:31:23 +08:00
parent e7fd5316fb
commit 9802d67470
3 changed files with 5 additions and 5 deletions

View File

@ -36,7 +36,7 @@ int printk_init(const int char_size_x, const int char_size_y)
// @todo:将来需要将帧缓冲区物理地址填写到这个地址的页表项中 // @todo:将来需要将帧缓冲区物理地址填写到这个地址的页表项中
VBE_FB_phys_addr = (ul *)info.framebuffer_addr; VBE_FB_phys_addr = (ul *)info.framebuffer_addr;
pos.FB_address = (uint *)0x0000000003000000; pos.FB_address = (uint *)0x0000000003000000;
pos.FB_length = pos.width * pos.height*2; pos.FB_length = pos.width * pos.height;
// ======== 临时的将物理地址填写到0x0000000003000000处 之后会在mm内将帧缓存区重新映射===== // ======== 临时的将物理地址填写到0x0000000003000000处 之后会在mm内将帧缓存区重新映射=====
@ -51,7 +51,7 @@ int printk_init(const int char_size_x, const int char_size_y)
ul *tmp1; ul *tmp1;
// 初始化2M物理页 // 初始化2M物理页
for (ul i = 0; i < (PAGE_2M_SIZE<<3); i += PAGE_2M_SIZE) for (ul i = 0; i < (pos.FB_length<<2); i += PAGE_2M_SIZE)
{ {
// 计算当前2M物理页对应的pdt的页表项的物理地址 // 计算当前2M物理页对应的pdt的页表项的物理地址
tmp1 = phys_2_virt((ul *)(*tmp & (~0xfffUL)) + (((fb_virt_addr + i) >> PAGE_2M_SHIFT) & 0x1ff)); tmp1 = phys_2_virt((ul *)(*tmp & (~0xfffUL)) + (((fb_virt_addr + i) >> PAGE_2M_SHIFT) & 0x1ff));

View File

@ -158,7 +158,7 @@ void system_initialize()
cpu_init(); cpu_init();
// test_slab(); // test_slab();
// test_mm(); test_mm();
// 再初始化进程模块。顺序不能调转 // 再初始化进程模块。顺序不能调转
// process_init(); // process_init();
} }

View File

@ -514,7 +514,7 @@ void init_frame_buffer()
ul vbe_fb_length = get_VBE_FB_length(); ul vbe_fb_length = get_VBE_FB_length();
ul *tmp1; ul *tmp1;
// 初始化2M物理页 // 初始化2M物理页
for (ul i = 0; i < (PAGE_2M_SIZE<<3); i += PAGE_2M_SIZE) for (ul i = 0; i < (vbe_fb_length<<2); i += PAGE_2M_SIZE)
{ {
// 计算当前2M物理页对应的pdt的页表项的物理地址 // 计算当前2M物理页对应的pdt的页表项的物理地址
tmp1 = phys_2_virt((ul *)(*tmp & (~0xfffUL)) + (((ul)(fb_virt_addr + i) >> PAGE_2M_SHIFT) & 0x1ff)); tmp1 = phys_2_virt((ul *)(*tmp & (~0xfffUL)) + (((ul)(fb_virt_addr + i) >> PAGE_2M_SHIFT) & 0x1ff));