Transitioning to the Kernel & Writing to a CD
Posted: Wed Aug 11, 2010 1:24 pm
So, I have a bootloader set up, which handles any possible interrupt errors and hangs the system just before entering protected mode. I have read other posts on this forum about protected mode, and I have also read about 64-bit Long Mode. I have searched an innumerable amount of times for a solution to my dilemmas -- or at least plausible, understandable solutions -- but no luck. Here are my questions:
1.) How do I, from my bootloader program, call a Kernel (which will be implemented in ASM), and execute? Do I change the RIP register to point to the entry point of my Kernel in memory? Additionally, how would I get my Kernel's starting address (like, how would I put it into memory like the bootloader)? Also -- sorry to bombard the OSDev community with this welter of inquiries -- how do I get into Long Mode?
2.) I have searched the web time and time again, yet I find no solution. Back in my days of technological infancy , I used to toy around with Batch programming, because that was what n00bs liked to call 'hacking.' I had found a CD that had been deemed "great for hacking," so I inserted it into the drive, and rebooted my system like it told me. On start-up, the BIOS ran the CD-ROM and -- WHAT -- Ubuntu is running on my computer?! How in the world do I get a CD to boot up with my bootloader, so I can run it on my laptop? I do not want any Microsoft products to have to be on there; I want this to be a one-system Operating System, like Linux, lol.
3.) A very long way away: would it be possible to create a function that verifies an executable before it is executed on the system? I wanted to create a new EXE file format (don't ask ) and have the function parse the 128-byte header (which would contain the entry point and references to sections) to test the validity, and to gather information. Then, it would call this kind of thing (not actual code):
So, any help would be GREATLY appreciated! Help an OSDev n00b like myself, please!
EDIT: Please correct me if I am wrong on any of this.
1.) How do I, from my bootloader program, call a Kernel (which will be implemented in ASM), and execute? Do I change the RIP register to point to the entry point of my Kernel in memory? Additionally, how would I get my Kernel's starting address (like, how would I put it into memory like the bootloader)? Also -- sorry to bombard the OSDev community with this welter of inquiries -- how do I get into Long Mode?
2.) I have searched the web time and time again, yet I find no solution. Back in my days of technological infancy , I used to toy around with Batch programming, because that was what n00bs liked to call 'hacking.' I had found a CD that had been deemed "great for hacking," so I inserted it into the drive, and rebooted my system like it told me. On start-up, the BIOS ran the CD-ROM and -- WHAT -- Ubuntu is running on my computer?! How in the world do I get a CD to boot up with my bootloader, so I can run it on my laptop? I do not want any Microsoft products to have to be on there; I want this to be a one-system Operating System, like Linux, lol.
3.) A very long way away: would it be possible to create a function that verifies an executable before it is executed on the system? I wanted to create a new EXE file format (don't ask ) and have the function parse the 128-byte header (which would contain the entry point and references to sections) to test the validity, and to gather information. Then, it would call this kind of thing (not actual code):
Code: Select all
ExecProc:
test rax, rax
jz __notvalidPUFF
lea rax, QWORD PTR [proc_addr]
push curr addr
push ...........
push ...........
mov rip, [rax]
; MAYBE I JUST NEED TO CALL THE INSTRUCTION ADDRESS FROM MEMORY??? (sure would make it a lot simpler)
EDIT: Please correct me if I am wrong on any of this.