• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
game of thought

Basic operating system development

20 posts in this topic

Hello, before anybody states it i realise how massive this is. I have an idea of an incredibly basic os containing maybe six commands, a text editor and an interpreted language interpreter. I read on osdev about various string and interger parsing and have a plan for it.

I have questions to those few who have done this before:

1: how long did it take you to create what i have stated above?

2:how long would it take to implement a basic api(i read about one on the gdn logie maybe a week ago)?

3: can you share a link about using cds as bootable media(looked around, i could only find floppy disk an usb sadly)?

4: should i write the kernel in x86 asm or c - libraries( i know both)?

As i said before i realise the enormity of the above task. If you wish to know how this connects to game development, i like the idea of working on something for something i have done, rather than a pre existing os because i would rather be satisfied by my achievement rather than anybody playing it.

Thank you for your time.

P.S. again i know this is probably crazy
0

Share this post


Link to post
Share on other sites
I agree with pointer2apointer, what is the point of this? If it is a learning excercise it's completely useless. You will probably never need to do anything that this involves in game programming, or programming in general. And it isn't a matter of time. It is excruciatingly complicated (From what I've read) And involves learning many different and extremely low level programming languages. Unless this is a requirement I don't recommend it, however you could still try and experiment with it.
1

Share this post


Link to post
Share on other sites
I took an OS course in my degree based off the [url="http://www.stanford.edu/class/cs140/projects/pintos/pintos.html"]pintos[/url] academic kernel, and it was a beast. The task was broken into four main sections that spanned the entire semester (with teams of 5), was boatloads of work, and that was [i]after[/i] the basic kernel had already been built: we added on to the existing infrastructure (well, virtual memory was empty before we touched it, but, yea). OS programming is a daunting task. If you have the right resources and a LOT of time, coupled with a very solid understanding of C and assembly, there's nothing saying it's impossible. It's some incredibly low-level debugging in many cases, and ultimately served to impress upon me how pleasant programming can be a few levels up from the metal.
0

Share this post


Link to post
Share on other sites
1. Depends on your experience.
2. I don't really understand the question ("gdn logie"?) but I guess the answer will be the same as #1.
3. Sadly I have no information here. Perhaps [url="http://www.google.com/search?q=osdev+bootable+cd"]Google knows[/url]?
4. I would choose C, for as much as possible.
0

Share this post


Link to post
Share on other sites
Im really sorry my ipod touch pad is bad because my thumb is to big for it, i meant gd.net lounge. And thank you for repiles so far.
0

Share this post


Link to post
Share on other sites
Even with plenty of time on your hands it's going to be very harsh and tough.

Try and answer some of these questions, and they will probably determine if you're able to complete this feat anytime soon:

1.Do you know in any good sense how GUIs work with OS kernels, how hardware interrupts work, how memory in kernels works, how kernels allocate user space for the user portion of programs to execute under a GUI or program/window structure for this process or purpose of using a text-editor?

If not, you'll need to:

1.Read up more on how operating systems work.

2.Read a LOT more on how kernels work.

3.Read how GUIs work.

4.Read more terminology involved in user space and kernel space, kernel architecture, and how kernels manage memory.

2.Do you know how the kernel communicates with the hardware?

If not, you'll need to:

1.Learn low-level programming, possibly Assembly, will help. Not to mention it can have other benefits(speed for one).

2.Learn about CPU hardware. A processor has a bunch of regions called [i]registers. [/i]

You should read this if you're not familiar with some basic processor architecture: [url="http://en.wikipedia.org/wiki/Processor_register"]http://en.wikipedia.org/wiki/Processor_register[/url]

Multi-core processor designs through Assembly and other higher-level programming environments are going to be much more tedious than single-core ones for optimum development.

Point is, you need to know your computer anatomy before you can give useful life to an effective operating system, and learning computer anatomy is not so easy because each computer's anatomy can vary.

A first step: research your current computer's hardware, and then learn more specifically from there. Most importantly, though, would be the processor, input and output, and memory to start with in the learning process.

Also, I'd try and learn about your BIOS, booting options, how exactly you plan on booting the kernel, etc.

It's not a type-and-go process like writing code on an already built OS is with everything you need taken care of for you(especially the ugly stuff that would make many game programmers facepalm).

Hope I helped somewhat!
1

Share this post


Link to post
Share on other sites
[quote name='Pointer2APointer' timestamp='1347917230' post='4981030']
1.Do you know in any good sense how GUIs work with OS kernels, how hardware interrupts work, how memory in kernels works, how kernels allocate user space for the user portion of programs to execute under a GUI or program/window structure for this process or purpose of using a text-editor?
[/quote]

GUIs? There's an enormously long road to follow before one can even start to think about writing a graphical system for an OS. It's probably a very good idea to not incorporate a graphical system at all for a first OS. Same goes for multi-core kernel design as it's hard enough to get a kernel to play nicely with a single CPU.

Knowledge of an assembly language for your hardware platform is a must, I'll even go as far as to say that you need quite some expertise in it as well, even if you're writing the majority of your system in a language like C. A solid understanding of an assembly language implies a good knowledge of what a CPU actually does under the hood, and that understanding is absolutely crucial if you're going to write a system which runs entirely on bare metal.

OS development is one of the most advanced topics you could tackle in computer science with almost no rewarding results, and it'd be wise to keep this in mind at all times.
1

Share this post


Link to post
Share on other sites
It is worth considering a 'dumbed-down' VM, designed for learning OS development.

One of my professors wrote [url="https://code.google.com/p/clown/"]CLOWN[/url], which was used in our Operating Systems design course. It's basically a much-simplified x86-style processor with minimal added complexity (just RAM, console I/O, hard drive, and interrupts). Takes an awful lot of the pain away, compared to learning on real hardware.
2

Share this post


Link to post
Share on other sites
I cant give any advice because I dont even know the slightest thing involved in making an OS, however I gotta say it sounds like a fun thing to do [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img] I am sure you will learn a lot from it

[quote name='game of thought' timestamp='1347817636' post='4980666']
As i said before i realise the enormity of the above task. If you wish to know how this connects to game development, i like the idea of working on something for something i have done, rather than a pre existing os because i would rather be satisfied by my achievement rather than anybody playing it.
[/quote]

They say making an engine is like reinventing the wheel, therefore making an OS would be like creating the universe.

Have fun with your project and good luck [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]

Edit: Doing a quick search I came across this, not sure if its useful at all http://www.academicearth.org/courses/operating-systems-and-system-programming Edited by Dynamo_Maestro
2

Share this post


Link to post
Share on other sites
"Operating Systems: Design and Implementation" is the definitive text on the subject. Grab a copy of the book and the latest source for Minix 3 and you'll be off to a good start.

1

Share this post


Link to post
Share on other sites
[quote name='xenobrain' timestamp='1347932254' post='4981098']
"Operating Systems: Design and Implementation" is the definitive text on the subject. Grab a copy of the book and the latest source for Minix 3 and you'll be off to a good start.
[/quote]
Thanks, like linus, didnt he based the original linix kernel off minix or something
0

Share this post


Link to post
Share on other sites
[quote name='game of thought' timestamp='1347949400' post='4981158']
[quote name='xenobrain' timestamp='1347932254' post='4981098']
"Operating Systems: Design and Implementation" is the definitive text on the subject. Grab a copy of the book and the latest source for Minix 3 and you'll be off to a good start.
[/quote]
Thanks, like linus, didnt he based the original linix kernel off minix or something
[/quote]

+1 on that one, it's great. Microkernels bring about some really interesting issues.
On the rest: I think most people replying are overly negative, it's not that hard. Especially if you make your bootloader take you to pmode directly, plus, if you want fancy resolutions GRUB (which is the loader I've used the most) can hand you off in some VESA mode.
Booting from a floppy is easy-peasy, I think USB can even emulate a floppy drive...? Anyway, if you want to split your system into many files without implementing a floppy driver and filesystem, you can - wait for it - let GRUB load it as a module. So easy!
What do you mean by a "basic API"? Syscalls to support libc, for example? If you strip down your memory protection, you don't need any API.
To write an editor (assuming console-based), you need to implement screen scrolling (maybe you can get this in hardware though), moving the carret, setting letters on-screen, etc. If you want a proper GUI, you have to draw the characters yourself, pixel by pixel.
For the languages, some people like to make their whole system in asm but I prefer to stick with C as long as I can. Some things need to be in asm (multitasking and configuration thingies, for example).
It sounds like a fun project, and not crazy at all!
1

Share this post


Link to post
Share on other sites
[quote name='patrrr' timestamp='1347957052' post='4981178']
What do you mean by a "basic API"? Syscalls to support libc, for example?
[/quote]
i mean like a basic graphical library, like curses or allegro. Should of clarified that.

And i am not planning a "GUI" as such, more of a command line interface, a la DOS or the (as far as i know) the original Unix.
0

Share this post


Link to post
Share on other sites
Maybe this guy can help: [url="http://mikeos.berlios.de/write-your-own-os.html"]http://mikeos.berlios.de/write-your-own-os.html[/url]

It helped straighten things out for me in many ways.
0

Share this post


Link to post
Share on other sites
For a more complete experience, it might be useful to learn via [url="http://en.wikipedia.org/wiki/Xv6"]xv6[/url], a simple Unix-like teaching operating system.

Here are some relevant resources:
http://pdos.csail.mit.edu/6.828/2011/xv6.html
http://pdos.csail.mit.edu/6.828/2011/xv6/book-rev6.pdf // even if you don't decide to use xv6 for learning, I'd still recommend to read Chapter 0
https://github.com/duckinator/xv6#readme

6.828 @ MIT:
http://pdos.csail.mit.edu/6.828/
// note: this links to the current version; the 2011 version above might have more lectures available

CS422/522 @ Yale:
http://zoo.cs.yale.edu/classes/cs422/2011/info#texts
http://zoo.cs.yale.edu/classes/cs422/2011/sched
http://zoo.cs.yale.edu/classes/cs422/2011/reference

W4118 @ Columbia:
http://www.cs.columbia.edu/~junfeng/12sp-w4118/syllabus.html

See also V6 (more of historical interest, since xv6 has replaced it):
http://www.lemis.com/grog/Documentation/Lions/

See also:
Operating Systems: Three Easy Pieces: http://pages.cs.wisc.edu/~remzi/OSTEP/
1

Share this post


Link to post
Share on other sites
[quote name='game of thought' timestamp='1347985519' post='4981291']
[quote name='patrrr' timestamp='1347957052' post='4981178']
What do you mean by a "basic API"? Syscalls to support libc, for example?
[/quote]
i mean like a basic graphical library, like curses or allegro. Should of clarified that.

And i am not planning a "GUI" as such, more of a command line interface, a la DOS or the (as far as i know) the original Unix.
[/quote]
Well, Unix preceded DOS by a couple of decades, and yes DOS did kind of copy the idea of a simple kernel API and a command-line shell from it, because it was a good design.

The way an OS like Unix or DOS works is that they have a simple basic API that userspace makes calls into the kernel to perform I/O and process control. Sitting on top of that is generally a set of more portable language bindings; on Unix that's a C library (often called "libc") but there was no such thing on the original DOS and you had to make kernel calls using interrupts from your higher-level language.

I would recommend you go with the Unix way: there are a number of small libc implementations (eg. newlib, ulibc) in which you just have to provide some 5 or 6 basic kernel API calls and the rest just appears. You can then build a cross-development GCC toolchain using that runtime and start building an entire POSIX system, including the classic Unix shell. All the heavy lifting is already done, all you have to do is write the kernel.

It's just that easy. Edited by Bregma
2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0