Lazarus

Free Pascal => Beginners => Topic started by: TYDQ on April 13, 2025, 11:27:29 am

Title: My kernel cannot response interrupt and screen cannot renewed.
Post by: TYDQ on April 13, 2025, 11:27:29 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 remain my problem about not refreshing my screen twice cause 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 setting or my APIC request got error?
I know there is something wrong in my code,but I don't know where and why,it can be in my whole code.
If you have a idea about this,you should look up all of my code to find out where the error occurs.
Title: Re: My kernel cannot response interrupt and screen cannot renewed.
Post by: Soner on April 13, 2025, 08:03:02 pm
I am not OS developer, I can't help you with your problem but I was curious looked at kernel.pas.
You don't call any function in kernel program, look at line 200-201, maybe this is the error.
https://github.com/TYDQSoft/UEFIPascalOS/blob/main/Kernel/kernel.pas
Title: Re: My kernel cannot response interrupt and screen cannot renewed.
Post by: TYDQ on April 14, 2025, 08:24:57 am
I am not OS developer, I can't help you with your problem but I was curious looked at kernel.pas.
You don't call any function in kernel program, look at line 200-201, maybe this is the error.
https://github.com/TYDQSoft/UEFIPascalOS/blob/main/Kernel/kernel.pas
However,The program will automatically call _start function(efi_main) due to the GNU linker(ld) will call this as a start entry.
It must be have error in kernel_main and not have error in PASCALMAIN.
Title: Re: My kernel cannot response interrupt and screen cannot renewed.
Post by: d2010 on April 15, 2025, 03:26:34 pm
I am not OS developer, I can't help you with your problem but I was curious looked at kernel.pas.
You don't call any function in kernel program, look at line 200-201, maybe this is the error.
https://github.com/TYDQSoft/UEFIPascalOS/blob/main/Kernel/kernel.pas
However,The program will automatically call _start function(efi_main) due to the GNU linker(ld) will call this as a start entry.
It must be have error in kernel_main and not have error in PASCALMAIN.
I do not how, but at the function inside kernel_initialize; his inside do not use
fillchar,zeromemory, .. Many times at intialized stage of application, these
function (fillchar,zeromemory, StrAlloc,) many time/s crash My app,
I replace fillchar with for clr:=00 to high()  pinteger[clr]:=000;
Yes, is more slow, but I do not how, why Pascal.Runtime need the slow solution.
Do not forge, at intialized stage-application/s, the Pascal.system.pas need intialized others
20'DLL attached *.DLL

{--}
You crash too much with memory Leaks.
C:Q1=Everyone, have a function/ for test-integrity-of -memory?
I replace theses
Code: [Select]
efi_freemem(memmap.memory_descriptor);
 efi_freemem(smemmap.memory_start);
 efi_freemem(smemmap.memory_size);
Eu multumesc ArsenieBoca, doamne ajuta-ne, doamne ajuta. Eu multumesc
 ArsenieBoca.
Code: [Select]
  if (memmap.memory_descriptor<>nil) then
  Begin   
 efi_freemem(memmap.memory_descriptor);
 memmap.memory_descriptor:=nil;
  End;

if (smemmap.memory_start<>nil) then
  Begin efi_freemem(smemmap.memory_start);
          smemmap.memory_start:=nil;
  End;
End;
Title: Re: My kernel cannot response interrupt and screen cannot renewed.
Post by: TYDQ on April 18, 2025, 03:23:19 am
I am not OS developer, I can't help you with your problem but I was curious looked at kernel.pas.
You don't call any function in kernel program, look at line 200-201, maybe this is the error.
https://github.com/TYDQSoft/UEFIPascalOS/blob/main/Kernel/kernel.pas
However,The program will automatically call _start function(efi_main) due to the GNU linker(ld) will call this as a start entry.
It must be have error in kernel_main and not have error in PASCALMAIN.
I do not how, but at the function inside kernel_initialize; his inside do not use
fillchar,zeromemory, .. Many times at intialized stage of application, these
function (fillchar,zeromemory, StrAlloc,) many time/s crash My app,
I replace fillchar with for clr:=00 to high()  pinteger[clr]:=000;
Yes, is more slow, but I do not how, why Pascal.Runtime need the slow solution.
Do not forge, at intialized stage-application/s, the Pascal.system.pas need intialized others
20'DLL attached *.DLL

{--}
You crash too much with memory Leaks.
C:Q1=Everyone, have a function/ for test-integrity-of -memory?
I replace theses
Code: [Select]
efi_freemem(memmap.memory_descriptor);
 efi_freemem(smemmap.memory_start);
 efi_freemem(smemmap.memory_size);
Eu multumesc ArsenieBoca, doamne ajuta-ne, doamne ajuta. Eu multumesc
 ArsenieBoca.
Code: [Select]
  if (memmap.memory_descriptor<>nil) then
  Begin   
 efi_freemem(memmap.memory_descriptor);
 memmap.memory_descriptor:=nil;
  End;

if (smemmap.memory_start<>nil) then
  Begin efi_freemem(smemmap.memory_start);
          smemmap.memory_start:=nil;
  End;
End;
You should DIY Your FillChar,ZeroMemory due to its bare metal UEFI environment.
Title: Re: My kernel cannot response interrupt and screen cannot renewed.
Post by: TYDQ on April 18, 2025, 04:23:48 pm
This problem is solved by hacking tricks.Thank everyone who help me solve my problem.
TinyPortal © 2005-2018