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

This forums is for OS project announcements including project openings, new releases, update notices, test requests, and job openings (both paying and volunteer).
chezzestix
Member
Member
Posts: 118
Joined: Mon May 05, 2008 5:51 pm

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

Post by chezzestix »

Where in the code does it do that? Thats a pretty stealth trick.
User avatar
IanSeyler
Member
Member
Posts: 326
Joined: Mon Jul 28, 2008 9:46 am
Location: Ontario, Canada
Contact:

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

Post 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
BareMetal OS - http://www.returninfinity.com/
Mono-tasking 64-bit OS for x86-64 based computers, written entirely in Assembly
chezzestix
Member
Member
Posts: 118
Joined: Mon May 05, 2008 5:51 pm

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

Post 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.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

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

Post by Combuster »

If you are looking for the method: Entering_Long_Mode_Directly
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
IanSeyler
Member
Member
Posts: 326
Joined: Mon Jul 28, 2008 9:46 am
Location: Ontario, Canada
Contact:

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

Post 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
BareMetal OS - http://www.returninfinity.com/
Mono-tasking 64-bit OS for x86-64 based computers, written entirely in Assembly
chezzestix
Member
Member
Posts: 118
Joined: Mon May 05, 2008 5:51 pm

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

Post 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?
User avatar
IanSeyler
Member
Member
Posts: 326
Joined: Mon Jul 28, 2008 9:46 am
Location: Ontario, Canada
Contact:

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

Post 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
BareMetal OS - http://www.returninfinity.com/
Mono-tasking 64-bit OS for x86-64 based computers, written entirely in Assembly
chezzestix
Member
Member
Posts: 118
Joined: Mon May 05, 2008 5:51 pm

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

Post 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
User avatar
IanSeyler
Member
Member
Posts: 326
Joined: Mon Jul 28, 2008 9:46 am
Location: Ontario, Canada
Contact:

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

Post 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
BareMetal OS - http://www.returninfinity.com/
Mono-tasking 64-bit OS for x86-64 based computers, written entirely in Assembly
chezzestix
Member
Member
Posts: 118
Joined: Mon May 05, 2008 5:51 pm

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

Post by chezzestix »

Your a saint and a scholar... however
now its asking for a Pure64.cfg
User avatar
IanSeyler
Member
Member
Posts: 326
Joined: Mon Jul 28, 2008 9:46 am
Location: Ontario, Canada
Contact:

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

Post 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
BareMetal OS - http://www.returninfinity.com/
Mono-tasking 64-bit OS for x86-64 based computers, written entirely in Assembly
Post Reply