OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Apr 19, 2024 4:49 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: OpenBSD and kernels
PostPosted: Mon Jul 23, 2001 11:00 pm 
Here is my question. I've recently been developing
a kernel on OpenBSD 2.6. For the moment, I am
simply testing. The kernel is pretty basic. It
includes a text driver and, at the moment, simply
copies characters into a character array and, then,
prints that character array to the screen. The
kernel portion is written in C using gcc. However,
I have also compiled this kernel using DJGPP on Windows
2000. I've read the documents and did what was
recommended. I used no library calls (except my
own) and I specified that the beginning address be
0x10000 via -Ttext to ld.

When I compiled this kernel on OpenBSD and linked
it statically using ld, I find that the ld on OpenBSD
does not support -oformat. Of course, it is supported
on FreeBSD and Linux, but not OpenBSD at all. I even
downloaded the new binutils but it wouldn't even configure
ld for my system at all.

Well, of course, DJGPP's ld does support -oformat.
When I use it, the kernel loads fine with the loader.
Btw, I am using the loader that I got from this site,
until I write my own. The kernel loads as expected,
prints out its information then loops forever, which is
what it is suppose to do.

Well, on OpenBSD...ld does still support -Ttext and
pretty much everything else except -oformat. I try to
compile my files into object files. Then I link the object
files together, specifying -Ttext. However, I attempted
to compensate for ld on OpenBSD not support -oformat by
running the linked binary through objcopy.

Here is what I'm specifying:

objcopy -O binary kernel32.bin.tmp kernel32.bin

It looks like it creates the binary file. Well, I put
the kernel from OpenBSD onto a floppy and name it kernel32.bin
so that the loader will load that file. Well, when it does,
it seems to triple fault, so the computer reboots. I was kind
of wanting to avoid using Windows 2000 as my primary development
platform as there are particular limitations I'm getting from
using DJGPP. I find that I can only specify a certain number of
arguments to the linker (ld) there. Although I don't think this
is a DJGPP thing, I think it's more or less a Windows 2000 error.
In addition to that though, DJGPP make seems to fault quite
often when I attempt to compile my kernel. At the moment, the kernel
includes around 45 files, most of them part of the library which I
wrote.

Also, another note to everyone, I have discovered that "long long"
probably should be avoided as certain functions are implaned into
your code when it is time to perform division or other forms of
math on quads...although I'm sure that most people here new that.

Anyway, I've wasted a lot of time here so far...but here is my
question. Am I using objcopy correctly? Is anyone else
experiencing any limitations with their number of arguments
when they us ld (DJGPP) on Windows 2000? It appears that my
arguments are limited to around 14. After that, Windows 2000
simply refuses to even load and execute ld.

Any help or pointing in the right direction would be very
appreciative. Thanks in advance.


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 170 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group