www.digitalmars.com         C & C++   DMDScript  

D - OS development in D starter kit

reply user domain.invalid writes:
I think there were a few people that wanted a look at this.  Its some 
very rudimentary D code for the worlds most rudimentary operating 
system.  In fact, to call it an operating system is giving it way too 
much credit.  The benefit of seeing this, if any, is to see how to boot 
a computer into D code using GRUB. The rest is up to you...or maybe 
me...but more likely you...

My next step, if I ever get there, is to handle keyboard interrupts and 
turn my computer into a hugely overpriced calculator.

I apologize for all non-standard conventions in this code.  There is a 
lot of learning taking place in this code.

There should be two attachments, the source code, and a screenshot of 
the OS booting in the BOCHS emulator.

Cheers,
Jan 26 2004
next sibling parent reply Clint Olson <user domain.invalid> writes:
Sorry about the bogus name, that was me.

user domain.invalid wrote:
 I think there were a few people that wanted a look at this.  Its some 
 very rudimentary D code for the worlds most rudimentary operating 
 system.  In fact, to call it an operating system is giving it way too 
 much credit.  The benefit of seeing this, if any, is to see how to boot 
 a computer into D code using GRUB. The rest is up to you...or maybe 
 me...but more likely you...
 
 My next step, if I ever get there, is to handle keyboard interrupts and 
 turn my computer into a hugely overpriced calculator.
 
 I apologize for all non-standard conventions in this code.  There is a 
 lot of learning taking place in this code.
 
 There should be two attachments, the source code, and a screenshot of 
 the OS booting in the BOCHS emulator.
 
 Cheers,
 
 ------------------------------------------------------------------------
 
Jan 26 2004
next sibling parent reply Manfred Nowak <svv1999 hotmail.com> writes:
Clint Olson wrote:

 There should be two attachments, the source code,
I cannot decompress the source: `not in gzip-format'. What is the md5sum please? So long.
Jan 26 2004
parent "Sean L. Palmer" <palmer.sean verizon.net> writes:
Ditto.  Winzip 8.1 doesn't like it either.

Sean

"Manfred Nowak" <svv1999 hotmail.com> wrote in message
news:bv39a0$oth$1 digitaldaemon.com...
 Clint Olson wrote:

 There should be two attachments, the source code,
I cannot decompress the source: `not in gzip-format'. What is the md5sum please? So long.
Jan 26 2004
prev sibling parent Clint Olson <noone nowhere.com> writes:
Sorry about that, the attached zip file of the source code should work 
much better..

Clint Olson wrote:
 Sorry about the bogus name, that was me.
 
 user domain.invalid wrote:
 
 I think there were a few people that wanted a look at this.  Its some 
 very rudimentary D code for the worlds most rudimentary operating 
 system.  In fact, to call it an operating system is giving it way too 
 much credit.  The benefit of seeing this, if any, is to see how to 
 boot a computer into D code using GRUB. The rest is up to you...or 
 maybe me...but more likely you...

 My next step, if I ever get there, is to handle keyboard interrupts 
 and turn my computer into a hugely overpriced calculator.

 I apologize for all non-standard conventions in this code.  There is a 
 lot of learning taking place in this code.

 There should be two attachments, the source code, and a screenshot of 
 the OS booting in the BOCHS emulator.

 Cheers,

 ------------------------------------------------------------------------
Jan 26 2004
prev sibling next sibling parent reply "Carlos Santander B." <carlos8294 msn.com> writes:
Can somebody please show me how to make a bootable floppy with this? What do
I do after kernel.elf is created? TIA.

-----------------------
Carlos Santander Bernal
Jan 26 2004
parent reply Clint Olson <noone nowhere.com> writes:
Carlos Santander B. wrote:
 Can somebody please show me how to make a bootable floppy with this? What do
 I do after kernel.elf is created? TIA.
 
 -----------------------
 Carlos Santander Bernal
 
 
I do it with the command: su -c "make bootfloppy" I do this on a linux system. I doubt things will work very well on a Windows system. It is probably rare that GRUB and gcc would be installed on a Windows system, and even then, the Makefile would need to modified for Windows commands (copy vs cp type stuff). Bottom line, never been done on Windows, would take some work if it was even possible, and I don't have the time to try it these days. I wrap "make bootfloppy" with the su command because some of the commands that create the boot floppy require root priveledge on my system, probably the "mount" and "grub" commands. You will need to have GRUB installed, though not nessarily as your bootloader, you just need to be able to execute the "grub" command. You will need to have FAT formatted floppy in inserted in which ever drive corresponds to /dev/fd0, typically this is the first floppy drive, sometimes referred to as the Windows a: drive. Possibly the "bootfloppy" target in the Makefile can shed more light on what is going on Hope this helps, Clint
Jan 26 2004
parent "Carlos Santander B." <carlos8294 msn.com> writes:
"Clint Olson" <noone nowhere.com> wrote in message
news:bv47ep$2c7h$1 digitaldaemon.com...
|
| I do it with the command:
|
| su -c "make bootfloppy"
|
| I do this on a linux system.  I doubt things will work very well on a
| Windows system.  It is probably rare that GRUB and gcc would be
| installed on a Windows system, and even then, the Makefile would need to
| modified for Windows commands (copy vs cp type stuff).  Bottom line,
| never been done on Windows, would take some work if it was even
| possible, and I don't have the time to try it these days.
|
| I wrap "make bootfloppy" with the su command because some of the
| commands that create the boot floppy require root priveledge on my
| system, probably the "mount" and "grub" commands.
|
| You will need to have GRUB installed, though not nessarily as your
| bootloader, you just need to be able to execute the "grub" command.
|
| You will need to have FAT formatted floppy in inserted in which ever
| drive corresponds to /dev/fd0, typically this is the first floppy drive,
| sometimes referred to as the Windows a: drive.
|
| Possibly the "bootfloppy" target in the Makefile can shed more light on
| what is going on
|
| Hope this helps,
|
| Clint
|
|

Thanks! I hadn't read the makefile.

-----------------------
Carlos Santander Bernal
Jan 28 2004
prev sibling parent reply =?iso-8859-1?Q?=22Robert_M._M=FCnch=22?= <robert.muench robertmuench.de> writes:
On Mon, 26 Jan 2004 00:02:30 -0800, <user domain.invalid> wrote:

 I think there were a few people that wanted a look at this.  Its some
 very rudimentary D code for the worlds most rudimentary operating
 system.  In fact, to call it an operating system is giving it way too
 much credit.  The benefit of seeing this, if any, is to see how to boot
 a computer into D code using GRUB. The rest is up to you...or maybe
 me...but more likely you...
Hi, thanks for this contribution. First time I understand the setup by not having to deal with huge number of files etc. I had a look at the d-kernel stuff by Mike Wynn but didn't made to handle it. For me there are to few docs how it works etc. I hope he joins in this dicussion and tells us a bit about his experience etc.
 My next step, if I ever get there, is to handle keyboard interrupts and
 turn my computer into a hugely overpriced calculator.
Can we evolve slowly your base and maybe look at some of the d-kernel stuff for step-by-step integration? Your code, as I understand it, doesn't use any D standard provided stuff (Phobos) of course. As I understood Mike's effort, he has changed some parts of phobos to be OS independent (raw-mode, without any dependency to an existing OS) to have some standard D modules available. I'm far from being an expert on OS development but IIRC the "libgc" project provides a standard C library in raw-mode, which can be ported to other platforms so you can use GCC to compile code. Is this right? WRT the current discussion about a Phobos design group, how about settingup a Phobos raw-mode group in parallel? IMO having phobos in a raw-mode version would be very interesting for embedded developers. At the moment we will only support x86 but IMO that's OK and is used in embedded projects quite often too. Just some thoughts... -- Robert M. Münch Management & IT Freelancer http://www.robertmuench.de
Feb 04 2004
parent reply Clint Olson <Clint_member pathlink.com> writes:
In article <opr2t6hqisum5vd8 news.digitalmars.com>,
=?iso-8859-1?Q?=22Robert_M._M=FCnch=22?= says...
On Mon, 26 Jan 2004 00:02:30 -0800, <user domain.invalid> wrote:

 I think there were a few people that wanted a look at this.  Its some
 very rudimentary D code for the worlds most rudimentary operating
 system.  In fact, to call it an operating system is giving it way too
 much credit.  The benefit of seeing this, if any, is to see how to boot
 a computer into D code using GRUB. The rest is up to you...or maybe
 me...but more likely you...
Hi, thanks for this contribution. First time I understand the setup by not having to deal with huge number of files etc. I had a look at the d-kernel stuff by Mike Wynn but didn't made to handle it. For me there are to few docs how it works etc. I hope he joins in this dicussion and tells us a bit about his experience etc.
I'm glad to hear it was of some interest/use to someone.
 My next step, if I ever get there, is to handle keyboard interrupts and
 turn my computer into a hugely overpriced calculator.
Can we evolve slowly your base and maybe look at some of the d-kernel stuff for step-by-step integration? Your code, as I understand it, doesn't use any D standard provided stuff (Phobos) of course. As I understood Mike's effort, he has changed some parts of phobos to be OS independent (raw-mode, without any dependency to an existing OS) to have some standard D modules available.
Believe me, my base will evolve slowly :) This is purely a recreational endeavor for me. I barely find time to work on it these days. Most of the work I put into it was based on using C/C++ over a year ago. A proof of concept port to D was quite simple and is what I posted on this forum. Your observation of both my effort and Mike's sounds correct. I actually tried to reach Mike by email at sereral email addresses, including the one listed on his d-kernel pages. They were returned as "undeliverable".
I'm far from being an expert on OS development but IIRC the "libgc" 
project provides a standard C library in raw-mode, which can be ported to 
other platforms so you can use GCC to compile code. Is this right?
In a race to see which of us is less of an expert in this field, I have a feeling I would win. I can't really answer your question athoritatively but it sounds feasible.
WRT the current discussion about a Phobos design group, how about 
settingup a Phobos raw-mode group in parallel? IMO having phobos in a 
raw-mode version would be very interesting for embedded developers. At the 
moment we will only support x86 but IMO that's OK and is used in embedded 
projects quite often too.
If a group can be formed, great! My concern is that it might be a group of one, you. I'm unlikely to contribute much, for two reasons, the first being available time, the second being subject matter knowledge. Booting my "simple" kernel was mostly a matter of reasearching how to use GRUB. Now I'm going to have to start learning about programming the intel hardware... (I'm a Java progammer, very little system/embedded programming). Not to mention the fact that I'm still learning D and also like D as an application development language. Hence, even less time available for my/our OS/PhobosEM effort.
Just some thoughts...
Thanks, I appreciate them, even though I don't have a lot of constructive responses.
Feb 05 2004
parent reply =?iso-8859-1?Q?=22Robert_M._M=FCnch=22?= <robert.muench robertmuench.de> writes:
On Thu, 5 Feb 2004 20:32:02 +0000 (UTC), Clint Olson 
<Clint_member pathlink.com> wrote:

 Your observation of both my effort and Mike's sounds correct.  I 
 actually tried to reach Mike by email at sereral email addresses, 
 including the one listed on his d-kernel pages.  They were returned as 
 "undeliverable".
Hi, same for me. So I just took his code and ran a diff against the normal Phobos code base. Quite interesting to see the changes he made. IMO a bit scattered but OK.
 In a race to see which of us is less of an expert in this field, I have a
 feeling I would win.  I can't really answer your question athoritatively 
 but it sounds feasible.
I had a short look at the glibc project. They state that it's not that easy to port because the lib is closely tied to the underlaying hardware (OK) and operating-system (hmmm...). This looks like a "first the OS than the lib approach". With D we could switch this: First bring Phobos to run on bare metal and than build an GCed OS on top if it :-) Sounds more evident to me.
 If a group can be formed, great!  My concern is that it might be a group 
 of one, you.  I'm unlikely to contribute much, for two reasons, the 
 first being
 available time, the second being subject matter knowledge.
Well, it's more playing around with all this stuff at the moment. Hey, other big players started the same ;-))
 Booting my "simple" kernel was mostly a matter of reasearching how to 
 use GRUB.
I need to master this step...
 Now I'm going to have to start learning about programming the intel 
 hardware... (I'm a Java progammer, very little system/embedded 
 programming).
As I don't like x86 ASM that much, I'm going to try to move up AFAP to get away from the ASM level.
 Thanks, I appreciate them, even though I don't have a lot of constructive
 responses.
No problem ;-) Same here. -- Robert M. Münch Management & IT Freelancer http://www.robertmuench.de
Feb 08 2004
parent =?iso-8859-1?Q?=22Robert_M._M=FCnch=22?= <robert.muench robertmuench.de> writes:
I got this stuff from Clint running on my Suse installation using VMWare. 
Creating the bootimage (which is only a file in VMWare) and using it as 
the start-image for a new d-kernel VMWare make the whole setup very 
comfortable. I think I have found a new toy to play around with :-))

-- 
Robert M. Münch
Management & IT Freelancer
http://www.robertmuench.de
Feb 08 2004