Page 3 of 3

Re: Pure64: a 64-bit OS loader (now with SMP initialization)

Posted: Tue Jan 20, 2009 1:27 pm
by chezzestix
Where in the code does it do that? Thats a pretty stealth trick.

Re: Pure64: a 64-bit OS loader (now with SMP initialization)

Posted: Tue Jan 20, 2009 1:58 pm
by IanSeyler
The source code for Pure64 isn't public.. it is binary only at the moment.

The source code included with Pure64 is the bootsector (which loads Pure64) and a few stub "kernels" in Assembly and C/C++.

-Ian

Re: Pure64: a 64-bit OS loader (now with SMP initialization)

Posted: Tue Jan 20, 2009 2:17 pm
by chezzestix
Ahhhhhhh, okay that makes sense. I was looking at the bootsector.asm and it looked like a straight forward kernel loader no protected mode jumps or anything.

Re: Pure64: a 64-bit OS loader (now with SMP initialization)

Posted: Tue Jan 20, 2009 2:23 pm
by Combuster
If you are looking for the method: Entering_Long_Mode_Directly

Re: Pure64: a 64-bit OS loader (now with SMP initialization)

Posted: Tue Jan 20, 2009 2:27 pm
by IanSeyler
No worries.

The bootloader loads the PURE64.SYS file from disk and starts it. That code was taken from the FreeDOS project and I modified it to suit the needs of Pure64.

Once Pure64 starts it gets the computer into 64-bit mode and activates any other CPU/cores in the computer. Pure64 then loads the OS kernel (currently called KERNEL64.SYS) and jumps to it.

Pure64 is intended to simplify OS development since the programmer doesn't have to worry about setting up the PC and loading their kernel from the disk.

If you would like to see some other code on getting into 64-bit mode you can look here:
http://www.cs.usfca.edu/~cruse/cs630f08/try64bit.s
http://flatassembler.net/examples/longmode.zip

-Ian

Re: Pure64: a 64-bit OS loader (now with SMP initialization)

Posted: Tue Jan 20, 2009 6:03 pm
by chezzestix
I've been trying to get this to work but to my frustration its fighting me the whole way.

My Steps:
Create VDI in VirtualBox
Use Balder(Freedos 1.0) to format the disk
Use Hexeditor to replace bootsector with pure64's
Use Balder again to copy the pure64.sys to C:
Restart virtual machine without balder floppy
Fail

dir confirms the file is there but its not working...
Is there a better way to do this process?

Re: Pure64: a 64-bit OS loader (now with SMP initialization)

Posted: Wed Jan 21, 2009 9:36 am
by IanSeyler
Hi chezzestix,

Is the hard drive image formatted with FAT32?
When you copied the boot sector did you overwrite the first 60 bytes of the boot sector in the disk image? The first 60 bytes of the boot sector need to remain since they store the information about the FAT32 partition. The boot sector code looks at this data to figure out how the file system is laid out.

-Ian

Re: Pure64: a 64-bit OS loader (now with SMP initialization)

Posted: Thu Jan 22, 2009 6:30 pm
by chezzestix
OK now I got it.

Steps:
Format with FAT32
Move .sys to HDD
Replace 5A - 1FE (offset based on beginning of boot sector) with pure64 boot sector
It Works!

Now I have to switch to QEMU because VirtualBox doesn't support 64 bit guests.

EDIT:
lol... QEMU throws a SMBIOS not detected

Re: Pure64: a 64-bit OS loader (now with SMP initialization)

Posted: Fri Jan 23, 2009 12:23 pm
by IanSeyler
Hi chezzestix,

I'm sorry about the problems you are having with Pure64. Please see the link below for the latest version that I'm still developing. This will remove the SMBIOS issue.

http://www.returninfinity.com/pure64/files-1/

Grab the file called pure64-20090107.zip

-Ian

Re: Pure64: a 64-bit OS loader (now with SMP initialization)

Posted: Fri Jan 23, 2009 10:17 pm
by chezzestix
Your a saint and a scholar... however
now its asking for a Pure64.cfg

Re: Pure64: a 64-bit OS loader (now with SMP initialization)

Posted: Sat Jan 24, 2009 1:19 am
by IanSeyler
OK. Just create an empty file called pure64.cfg in the root.

This config file isn't used yet but will allow you to change a few things (Like the name of the kernel to load)

-Ian