My kernel cannot response interrupt from APIC and I don't know where the error occurs
Posted: Sun Apr 13, 2025 3:17 am
My total problematic kernel is on https://github.com/TYDQSoft/UEFIPascalOS
I was confused when I trying to execute my kernel in UEFI and faced the problem as the title,which remain my problem unknown.
The screen should be renewed once,However,the Virtual Machine testing result indicate that the screen will not to be renewed.
Does My kernel have some error in idt and gdt or my APIC request got error?
My kernel main code is:
I was confused when I trying to execute my kernel in UEFI and faced the problem as the title,which remain my problem unknown.
The screen should be renewed once,However,the Virtual Machine testing result indicate that the screen will not to be renewed.
Does My kernel have some error in idt and gdt or my APIC request got error?
My kernel main code is:
Code: Select all
procedure kernel_main;[public,alias:'kernel_main'];
var ptr1,ptr2,ptr3,ptr4:Pointer;
request:acpi_request;
begin
ptr4:=graph_heap_allocmem(gheap.screen_width,gheap.screen_height,1,1,true);
ptr1:=graph_heap_allocmem(640,480,1,1,true);
ptr2:=graph_heap_allocmem(960,720,641,481,true);
ptr3:=graph_heap_allocmem(640,480,1281,961,true);
graph_heap_draw_block(ptr4,1,1,gheap.screen_width,gheap.screen_height,graph_color_red);
graph_heap_draw_eclipse(ptr1,1,1,240,360,graph_color_yellow);
graph_heap_draw_fanshape(ptr2,480,360,300,60,120,graph_color_green);
graph_heap_draw_block(ptr3,200,1,240,480,graph_color_blue);
graph_heap_output_screen;
kernel_handle_function_init(@kernel_timer);
kernel_handle_function_add_param(Pointer(ptr1));
request.requestrootclass:=acpi_request_x86_local_apic;
request.requestsubclass:=acpi_request_x86_local_apic_timer;
request.requestAPICIndex:=1;
request.requestTimer:=10;
request.requestTimerStatus:=0;
request.requestNumber:=33;
acpi_cpu_request_interrupt(os_cpuinfo,request);
while True do;
graph_heap_freemem(ptr2);
graph_heap_freemem(ptr1);
graph_heap_freemem(ptr4);
graph_heap_freemem(ptr3);
end;