Page 1 of 1
Visual Studio for OS Developement
Posted: Fri Mar 28, 2008 12:18 am
by karloathian
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]
Posted: Fri Mar 28, 2008 1:43 am
by bewing
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
Posted: Fri Mar 28, 2008 7:45 am
by binutils
i have never heard of anything which open source works fine with MS product, even if cygwin or mingw even though their great efforts.
better off to try pure open-source or MS-pro product(just like singularity, cosmos etc)
Posted: Fri Mar 28, 2008 2:10 pm
by karloathian
bewing 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
Thanx , I'll definitly have a look into it
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
Posted: Tue Jul 15, 2008 9:54 pm
by trolly
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
Re: Visual Studio for OS Developement
Posted: Wed Jul 16, 2008 2:04 pm
by cr2
The
BrokenThorn Entertainment tutorials contains information writing a PE kernel with MSVC++.
Re: Visual Studio for OS Developement
Posted: Wed Jul 16, 2008 5:33 pm
by PatrickV
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
Posted: Thu Jul 17, 2008 8:32 pm
by tadada
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.
Re: Visual Studio for OS Developement
Posted: Fri Jul 18, 2008 3:12 pm
by Adek336