So I've begun working on my own Hobby OS a few months ago, and for the kick of it ( because kernel development isn't hard enough ) I wanted to modify my kernel to be GRUB compliant and the PE format spewed out by Visual Studio.
I've pretty much been able to port most of my basic code from the GCC version to a MSVC version , along with using NASM instead of MASM. Anyway I'll get to the core of the question, I've been using this tutorial on creating a multiboot compliant PE, but the problem lies in the fact that GRUB needs to know where my code ends , where my .text section is , etc. The tutorial worked for a while , but at some my point .text grew larger and the physical addresses changed.
So my real question would be , is there a way like with LD to tell the linker to input the physical addresses of the .text sections .data and .code ?
ps. sorry for the long rant[/url]
Visual Studio for OS Developement
You might want to take a look at the JLOC linker. You say you are using NASM now? I am using JLOC with NASM, and it gives you the complete ability to set all addresses and locations for every code/data segment. Setting up the control script is a bit iffy, but you only have to do it once.
You can find jloc on osdever.net
You can find jloc on osdever.net
- karloathian
- Posts: 22
- Joined: Fri Mar 28, 2008 12:09 am
Thanx , I'll definitly have a look into itbewing wrote:You might want to take a look at the JLOC linker. You say you are using NASM now? I am using JLOC with NASM, and it gives you the complete ability to set all addresses and locations for every code/data segment. Setting up the control script is a bit iffy, but you only have to do it once.
You can find jloc on osdever.net
EDIT: Finally I was able to modify my code and make it so that GRUB would directly understand the PE format. I must really like torturing myself to be doing this.
Re: Visual Studio for OS Developement
hi
here is a sample code for a multiboot kernel writen in visual c
in the code, the .text and .section is defined at 0x0
the .text in the header should correspond to the image size, i use also a utility (include in the zip file) to fix this value
kernel source
http://7a1pjw.bay.livefilestore.com/y1p ... p?download
multiboot header fixer code and binary
http://7a1pjw.bay.livefilestore.com/y1p ... p?download
here is a sample code for a multiboot kernel writen in visual c
in the code, the .text and .section is defined at 0x0
the .text in the header should correspond to the image size, i use also a utility (include in the zip file) to fix this value
kernel source
http://7a1pjw.bay.livefilestore.com/y1p ... p?download
multiboot header fixer code and binary
http://7a1pjw.bay.livefilestore.com/y1p ... p?download
Re: Visual Studio for OS Developement
The BrokenThorn Entertainment tutorials contains information writing a PE kernel with MSVC++.
OS-LUX V0.0
Working on...
Memory management: the Pool
Working on...
Memory management: the Pool
Re: Visual Studio for OS Developement
I use Visual Studio all the time when i create my os. But i don't do it in c. The Program can open up .asm file which when i comple things with nasm and error found . It is much easeir to use visual studio than text edit or otherwise i'll be counting lines all day anyway, nasm does not respond to end code sections far to my knowledge
Re: Visual Studio for OS Developement
I use notepad++. just a text editor with syntax highlighting and it numbers the lines. (the main reason I got it. I once resorted to number every 25 lines... it didn't work out too well.) The syntax highlighting and the line numbering is a godsend and it is small and fast. Plus I don't have to work with a MS product (except for windows itself, while I do have a linux box I find programming my OS eaisier on windows .) Its pretty good. On wikipedia there is a page about text editors with links to a lot. Thats where I found notepad++. Theres other programs too though.
My OS: SOS (Simple Operating System).
Re: Visual Studio for OS Developement
there's a funny joke on notepad+ http://tnerual.eriogerg.free.fr/0xBABAF000L/10_en.html