Proto OS - Open source OS Needs more developers

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
beyond infinity lazy

Re:Proto OS - Open source OS Needs more developers

Post by beyond infinity lazy »

I feel goosflesch prickling up my back upon reading thee words, opteron...

Have you even considered reading what the others here suggest you? Gosh, take a plain sheet of paper and draw it - make sketches about what you want to do in which order. Use *normal* words or sentences and *forget* about programming languages or implementation! Get a clue of what to do!! D'ya know nassi shneiderman or even stinknormal flow diagrams?

... i remember you've said something about being a programmer in an other post of yours... Don't you feel like being on the edge before becoming the worlds biggest git?
bkilgore

Re:Proto OS - Open source OS Needs more developers

Post by bkilgore »

Saying it needs to "allocate memory, etc" isn't good enough. That's not enough of a definition to get you anywhere. You need to sit down and think *exactly* how you want it to allocate memory. Do you want it in certain size pages? do you want it to be aligned on any certain boundaries?

Part of software engineering is setting specific, high-level goals that define exactly the problem you want to be solved. You started out with a very high-level objective "allocate memory", but you must break this down into manageable chunks. If you don't know how to do this (how to define problems, break them down into smaller, manageable chunks, and then figure out how to solve them), then maybe you need to practice your programming on smaller things before taking on the formidable challenge of trying to code an entire operating system.

Pretty soon you'll be getting into even harder problems like how do i handle multiple processes? how do i use paging to allow allocations in the whole 4gb address space instead of just how much memory the system has? how do i write a driver to interact with the pci bus? how do i pass messages between processes? etc

The only thing I can suggest is start simple. Like I said before, with my memory "allocator" that just gave a chunk of unused memory and incremented its pointer. It's surely not efficient. It doesn't provide for memory reuse or alignment or anything else. But it works, and it solves the basic problem of getting a block of free memory.

Just start simple, read some tutorials, and just start writing code. Even if it doesn't work at all, write it, figure out why it doesn't work, and then find out how to fix those problems, and start the process all over again.

It takes a lot of time, and it takes a lot of patience. Good luck.

- Brandon
Ozguxxx

Re:Proto OS - Open source OS Needs more developers

Post by Ozguxxx »

Hey, stop writing os development ethics 102 lecture notes :P here and write something more useful to this thread-> http://www.mega-tokyo.com/forum/index.p ... eadid=4181
, it is more meaningful and also I think OpteronELITE understood what you meant... Nothing personal, you know. ;)
bkilgore

Re:Proto OS - Open source OS Needs more developers

Post by bkilgore »

Well I didn't get the impression he understood what I meant because he responded with "I know what I need to get it to do. Allocate memory, etc"

I was just trying to help get him on the right track.

And I don't have anything to contribute to a real-time operating system discussion...but you can feel free to contribute to it if you like.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Proto OS - Open source OS Needs more developers

Post by Pype.Clicker »

some kind of picture you should consider ... and try to state the problem you face with similar stuff, seeing what you'll need in order to maintain your memory.

This picture suggest that :
1) there are free and used regions. You need to keep track of free regions'size
2) as there may be several free regions to be checked when you allocate memory, you'll need to link them (for instance using a chain)
3) allocating X bytes means that you a. find a region big enough and b. resize it to get some memory from it.
4) freeing a region just means that you add it in the free regions list.

from there, your implementation is trivial:

Code: Select all

struct free_region {
    int size;
    struct free_region *next;
}

free_region *free_memory;

void *alloc(int size)
{   
    free_region *ptr, *ptrv;
    void* mem;

    // look for a big enough region:

    for (ptr=free_memory, prev=NULL; ptr && ptr->size<size; ptr=ptr->next)
        prev=ptr;
    if (!ptr) return NULL;

     // get the head of that region as free memory
    mem=ptr;
    ptr=(free_region*)mem+size;
     *ptr=*((free_region*)mem);
    ptr->size-=size;

    if (ptr->size) {
      // change the free list to restore a good state.
      if (prev) prev->next=ptr;
      else free_memory=ptr;
    } else {
      // the whole region has been used. remove it from the list
      if (prev) prev->next=ptr->next;
      else free_memory=ptr->next;
    }
    return mem;
}
free(x,p) is left as an exercice. Of course, this is the WorstEverQuickAndDirtyMemoryManager... just a 1O min' stuff to explain the approach to be followed.

One thing you should ask yourself: are you trying to allocate addresses (this is what this procedure do) or pages for virtual memory (this is what cottontail memman do)
both are useful, but they're not the same thing at all ...


[attachment deleted by admin]
OpteronELITE

Re:Proto OS - Open source OS Needs more developers

Post by OpteronELITE »

I HAVE LESS THAN 10 DAYS TO FINISH MY OS! My parents will not pay for my Internet, and will not let me get a job! So I am under alot of pressure.
bkilgore

Re:Proto OS - Open source OS Needs more developers

Post by bkilgore »

Why do you have to finish an OS in 10 days? That seems to be a pretty impossible task. Is this for a school project or something?
Ozguxxx

Re:Proto OS - Open source OS Needs more developers

Post by Ozguxxx »

Then dont finish it, why *MUST* you write an operating system? Nothing personal, you know ;)
OpteronELITE

Re:Proto OS - Open source OS Needs more developers

Post by OpteronELITE »

Becasue my parents stop paying for my ISP! And I will not get anymore helpful resources. So I will probably fail. :( I am writing the OS becasue I WANT to.
anubis

Re:Proto OS - Open source OS Needs more developers

Post by anubis »

Writing an OS in 10 days is an impossible task sadly. It might take a minimum of 6 months or more till u get a working copy of your OS with basic qualities like a comaand interpretor or something like that. GUI takes more than a year. :(
OpteronELITE wrote: Becasue my parents stop paying for my ISP!
Difficulties always creap in projects and consider this as one. ;) I can suggest you one idea out that you could download code and FAQ's while you r online for some days. They give u a lot of insight. Whenever u get a problem u cant solve in a couple of days just post on the forum you will get answers alright. ;)Thats what i did when i went to University and was off the web for many months. I downoaded a GB or so of info.
There are many OS's designed by both pros and amatuers available on the net. Download them and read them thorough they always will solve most of ur problems. These forum pages also contain much information that r enough to write one. Delve through them too. :o
GOOD LUCK!!! and take it easy.
frank

Re:Proto OS - Open source OS Needs more developers

Post by frank »

Go to an "internet cafe" in your area.
Get some books from the library or book shop.
Print all the documentation you need.
(perhaps download some other os sources as example)

Best,
Frank
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Proto OS - Open source OS Needs more developers

Post by Solar »

OpteronELITE wrote: I HAVE LESS THAN 10 DAYS TO FINISH MY OS! My parents will not pay for my Internet, and will not let me get a job!
Erm... I'd daresay you need neither a job, an ISP or an OS to be finished.

What you need is a life... ::)
Every good solution is obvious once you've found it.
beyond infinity lazy

Re:Proto OS - Open source OS Needs more developers

Post by beyond infinity lazy »

hm. He'd also need ability to gain his life.

No wonder his parents are depriving him of isp and so forth. with this attitude of wanting wanting and not showing efforts regardless what ever one tells him ... Oh, I know I know, i shall not speak in harsh tones. But hard things can't be told the nice way. they'd still remain hard.
mr. xsism

Re:Proto OS - Open source OS Needs more developers

Post by mr. xsism »

www.netzero.com <<-- cheap and free internet

For help, come to osdever.net. We aslo have an irc channel. I can help you has 3 of us are programming MM ATM. I already have an alloc(). I am setting it up now. We can always help. irc.wyldryde.net @ #osdev

Regards,
mr. xsism
Post Reply