FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

D Newbies

 
Post new topic   Reply to topic     Forum Index -> General
View previous topic :: View next topic  
Author Message
exquisitus



Joined: 20 Apr 2004
Posts: 6

PostPosted: Tue Apr 20, 2004 6:55 am    Post subject: D Newbies Reply with quote

I am a newbie to D. Actually, I am hoping to be a newbie. I have not written my first line of D code yet. But I am sure I can because I have adequate C/C++ skills.

But, I have been reading quite a bit about D since reading about it on OsNews.com yesterday (2004/04/19). The more I read, the more I liked D. So, I decided to come here and signed up. I am in the process of writing my own OS. Yes, I am an OS hobbyist. The first question I have is, can D be called from C/Asm? I heard and read that D can use C API by linking against it. That is nice and dandy, but how will I make the jump from Asm/C to D if I wanted to write my OS in Asm & D?

Because of questions like that and possibly more as I try to make D useful. I decided to start this newbie topic.

Thanks all and D does look promising. I love Asm/C/C++, and to see a language that looks like C/C++ but cleans it up like Java, it is great. I really like some of the things I have been reading about D. One thing I didn't like about Java was that it forced you to be OO. D took the best of C, C++, Java, and I heard C#. I don't know anything of C#.

I look forward to participating.

.v
_________________
Seeking the ultimate question to life, the universe, and everything.
I am a Linuxian, from the planet Linux.
Back to top
View user's profile Send private message
jcc7



Joined: 22 Feb 2004
Posts: 657
Location: Muskogee, OK, USA

PostPosted: Tue Apr 20, 2004 8:49 am    Post subject: D As An OS Reply with quote

Welcome to D.

exquisitus wrote:
I am in the process of writing my own OS. Yes, I am an OS hobbyist. The first question I have is, can D be called from C/Asm? I heard and read that D can use C API by linking against it. That is nice and dandy, but how will I make the jump from Asm/C to D if I wanted to write my OS in Asm & D?
If I understand you correctly, you want to write an OS kernel in D. (If you want to write the kernel in C/Asm and then call D, the following info might not be helpful.)

Two or three people have already discussed writing a kernel in D on the official newsgroup. Their discussions were mostly over my head, but I can direct you to some of the threads:

Dernel the D Kernel
Dernel: _moduleCtor not working correct?
Dernel: D & interrupt handling
Dernel: dynamic arrays
Dernel: Inline Assembler question
Dernel: how does exception handling work?
Dernel: pointer arithmetic question
Dernel: Protected mode far pointers in D?
Dernel: Using D's GC as kernel memory manager?

OS development with D (Just found)
OS development in D starter kit (Just found)

I'm pretty sure the dernel threads grew off of an earlier thread, but these are the threads that I found right away.


Last edited by jcc7 on Wed Apr 21, 2004 9:08 pm; edited 2 times in total
Back to top
View user's profile Send private message AIM Address
Wienczny



Joined: 10 Apr 2004
Posts: 35

PostPosted: Tue Apr 20, 2004 5:24 pm    Post subject: Reply with quote

To write an OS kernel in D is on my todo list, too. What kind of kernel do you want to write? Microkernel? Something like L4Ka::Pistachio microkernel?
Back to top
View user's profile Send private message AIM Address MSN Messenger
exquisitus



Joined: 20 Apr 2004
Posts: 6

PostPosted: Tue Apr 20, 2004 8:06 pm    Post subject: uKernewl Reply with quote

Wienczny wrote:
To write an OS kernel in D is on my todo list, too. What kind of kernel do you want to write? Microkernel? Something like L4Ka::Pistachio microkernel?


I am shooting for a message based micro-kernel. I don't know anything about writing an OS. I am an embedded programming and my major was EE. but i love programming. I know enought of the intel x86 to do get into protected mode and i have some idea of the theory. ihave written boot loaders and kernels which don't do much more than print some info about the system (not really a kernel as it doesn't do anything useful). but in theory, i can extend it. i was just playing around with ideas and i would like to do a bit more planning before i start to write again. i want to have some direction instead of just playing around.

originally, i wanted to use C++. when using C/C++ for kernel development, it is clear how to call the C code and what you needed to support C++ (new/delete) and some other things to run the global and constructors. i then decided to stick with C and wait until i was further along to mess with C++. I heard that D links to C, but i don't know much yet to call D from C.

i would like to know that kind of things for D. i really think D with its clarity, can be a really nice language for kernel dev.
_________________
Seeking the ultimate question to life, the universe, and everything.
I am a Linuxian, from the planet Linux.
Back to top
View user's profile Send private message
l8night



Joined: 03 May 2004
Posts: 32
Location: UK

PostPosted: Mon May 03, 2004 6:01 pm    Post subject: Reply with quote

I started ....
http://www.geocities.com/one_mad_alien/dkernel.html
it boots, and talks to the keyboard and vga screen.
however that was before walters reorganisation of phobos, and I did have to hack the gc a little (but it does have GC).
its flat memory, never bothered to enable paging, no threading etc
but a start. only compiles under linux dmd NEEDS dmd 0.74 (needs gcc + objdump) I am thinking of trying to compile gdc under mingw (used this originally for the C and C++ versions of the kernel [c++ worked [ish] had hassles getting RTTI and exceptions working so gave up])

if there is an interest in continuing (I only did it to prove something could be started) then I may try to get it compiling under 0.86, running under bochs and make it a project here (then all we need is a few graphics drivers and port the swt) [I have the FDC code in my C++ version working and some IDE code somewhere too fat32fs should not be a major challenge]
Back to top
View user's profile Send private message
exquisitus



Joined: 20 Apr 2004
Posts: 6

PostPosted: Tue May 04, 2004 4:27 am    Post subject: Reply with quote

l8night wrote:
I started ....
http://www.geocities.com/one_mad_alien/dkernel.html
it boots, and talks to the keyboard and vga screen.
however that was before walters reorganisation of phobos, and I did have to hack the gc a little (but it does have GC).
....


This is great. I went to your page and see you have two versions. i will study both and see if i can't make some changes. some of the things i will try to do are:
- work in bochs (that is what i use for playing around)
- grub (then u don't have to worry about making your own 3-stage boot loader)

Thanks for posting what you have done.
_________________
Seeking the ultimate question to life, the universe, and everything.
I am a Linuxian, from the planet Linux.
Back to top
View user's profile Send private message
l8night



Joined: 03 May 2004
Posts: 32
Location: UK

PostPosted: Tue May 04, 2004 2:11 pm    Post subject: Reply with quote

Grub support was one thing I though about ... but I had fasm code for a boot load and Grub support ment I had to read lots of other ppls docs!
also the original plan (many moons ago) was to have a CD booting OS basically to turn your PC into a games console, or for dedicated servers.

best of luck getting it running Smile post your progress here or email/msg me if you get stuck.
Back to top
View user's profile Send private message
jcc7



Joined: 22 Feb 2004
Posts: 657
Location: Muskogee, OK, USA

PostPosted: Sun Jul 18, 2004 12:45 pm    Post subject: D Kernel Reply with quote

There's a new post on dm.D related to this topic.

From digitalmars.D:6448:
Quote:
Hi Everyone,
Earlier this year I started writing an operating system using D. It uses a microkernel design, and is targeted at x86 PCs. I had lots of great plans for the operating system, but I never got them even close to being realized. At the moment, I've stopped working on it with no plans to continue, so I decided to release what source code I had already made.

It basically has just 4 parts that are finished/working:
1) An interface to be loaded by a multiboot compatible boot loader
2) A text driver
3) A memory manager which uses paging and can keep track of 4GB of memory. (simple reservation system, kmalloc, etc.)
4) A tool for automatically creating a bochs hard drive image after each compile, which allows for very fast testing.

Anyhow, if you're interested, you can download it here:
http://members.shaw.ca/bradenm_k/misc/picos2004a.tar.gz

I don't claim to be a great programmer, and this was my first operating system. Nonetheless, I feel it may be helpful to someone.

P.S. The last compiler I used for this was either DMD 0.92 or 0.93 - perhaps you might get some new compiler errors/warning due to deprecated features. Also, the Makefiles are all set up for Linux. It would be a lot of work to get this to compile on Windows.
Back to top
View user's profile Send private message AIM Address
jcc7



Joined: 22 Feb 2004
Posts: 657
Location: Muskogee, OK, USA

PostPosted: Mon Jul 19, 2004 10:57 pm    Post subject: Reply with quote

From dkernel / looking for "one mad alien":
Quote:
Couldn't reach One Mad Alien by email, thus I am posting this on the list Smile

The dkernel (http://www.geocities.com/one_mad_alien/dkernel.html) now
compiles with the current dmd and incorporates some new phobos functions.

The current version can be found at:
http://dmd.kuehne.cn/dkernel-2004-07-19.tar.bz2

Thomas


Update

I created a wiki page for D Kernel info:
http://www.prowiki.org/wiki4d/wiki.cgi?KernelWithD
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> General All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group