Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.os.development > #8370

OS startup goals and steps

From "James Harris" <james.harris.1@gmail.com>
Newsgroups alt.os.development
Subject OS startup goals and steps
Date 2015-07-14 10:35 +0100
Organization A noiseless patient Spider
Message-ID <mo2l1n$7o2$1@dont-email.me> (permalink)

Show all headers | View raw


You guys may be interested in this and/or have some suggestions or 
thoughts on it. I have worked up a set of goals and steps to get an OS 
running, considering having the OS run on x86 (3 modes) and ARM so there 
are to be four versions of the OS with a common startup approach. There 
are only three primary goals:

Goal 1. Start logging so that info can be captured
Goal 2. Start multitasking so that other init can be concurrent
Goal 3. Interact with the user (i.e. the OS is ready for use)

The goals are intended to be achieved in order and they guide the set of 
steps that the OS startup needs to follow. The steps are currently as 
follows with the numbered goals shown at the points where they will have 
been achieved.

  - Set up initial register values
  - Set up temporary memory management, if required
  - Identify a small buffer to log to, say 8k
  - Capture whatever is already on the screen
  - Identify a basic upcounter and a time-of-day clock, if any
  - Set up somewhere to write debugging output, e.g. VGA
  - Set up logging and a console
1. Achieved goal to start logging

  - Carry out interactions that may not be possible in final OS mode
   - PC architecture
    - Get the century and the rest of the date and time
    - Hide the text-mode cursor (int 0x10_12 bl=0x34 or int 0x10_01)
    - Find out what memory we have available
      - e820 or similar modified by 0x15_c1 etc
        - Set ES=0 on entry or some BIOSes will set carry
    - Get info about machine, possibly including MCA (int 0x15_c0)
    - Ensure A20 is enabled (asm)
  - Enter OS mode, as required
    - Real mode:
      - Save original interrupt vectors, for info
    - Pmode:
      - Enable Pmode (asm)
      - Set up paging
    - Long mode:
      - Enable long mode (asm)
      - Set up paging
    - ARM:
      - Save original interrupt vectors, for info
      - Set up paging (possibly)
  - Set up memory management (mode-specific C)
  - Set up new logging and copy from prior buffer (C)
  - Interrupt controller and interrupt receipt (architecture-specific C)
  - A ticker (C)
  - Real-time clock
  - A scheduler and multitasking (C)
  - Jump to idle task stub
2. Achieved goal to start multitasking

  - Launch tasks for concurrent hardware discovery (C)
  - Once enough of the machine is ready start the shell (C)
3. Achieved goal to start interacting with user

You will likely see some familiar things in there and maybe some 
differences.

I have marked some steps as to be carried out in asm or C but I think it 
is heading for having most of the initial steps in asm and the later 
steps in C. The asm modules are there primarily because they need to do 
some things that C cannot.

I have some of the x86_16 stuff working but, before I write much more I 
thought it was a good time to take stock and look at how my startup 
would need to be modified to accommodate different architectures so that 
there was a common approach.

James

Back to alt.os.development | Previous | NextNext in thread | Find similar | Unroll thread


Thread

OS startup goals and steps "James Harris" <james.harris.1@gmail.com> - 2015-07-14 10:35 +0100
  Re: OS startup goals and steps "Rod Pemberton" <boo@fasdfrewar.cdm> - 2015-07-15 04:00 -0400
    Re: OS startup goals and steps "Rod Pemberton" <boo@fasdfrewar.cdm> - 2015-07-15 22:29 -0400
      Re: OS startup goals and steps "James Harris" <james.harris.1@gmail.com> - 2015-07-16 08:00 +0100
        Re: OS startup goals and steps "James Harris" <james.harris.1@gmail.com> - 2015-07-16 11:01 +0100
          Re: OS startup goals and steps "Rod Pemberton" <boo@fasdfrewar.cdm> - 2015-07-17 05:40 -0400
            Re: OS startup goals and steps "wolfgang kern" <nowhere@never.at> - 2015-07-17 17:58 +0200
        Re: OS startup goals and steps "Alexei A. Frounze" <alexfrunews@gmail.com> - 2015-07-16 03:24 -0700
  Re: OS startup goals and steps "James Harris" <james.harris.1@gmail.com> - 2015-07-16 10:32 +0100
    Re: OS startup goals and steps "wolfgang kern" <nowhere@never.at> - 2015-07-16 16:04 +0200
      Re: OS startup goals and steps "James Harris" <james.harris.1@gmail.com> - 2015-07-17 06:44 +0100
        Re: OS startup goals and steps "wolfgang kern" <nowhere@never.at> - 2015-07-17 17:50 +0200
    Re: OS startup goals and steps "Rod Pemberton" <boo@fasdfrewar.cdm> - 2015-07-17 06:10 -0400
      Re: OS startup goals and steps "James Harris" <james.harris.1@gmail.com> - 2015-07-17 18:07 +0100
        Re: OS startup goals and steps "Rod Pemberton" <boo@fasdfrewar.cdm> - 2015-07-18 03:35 -0400
  Re: OS startup goals and steps "wolfgang kern" <nowhere@never.at> - 2015-07-16 14:42 +0200
    Re: OS startup goals and steps "Rod Pemberton" <boo@fasdfrewar.cdm> - 2015-07-17 05:48 -0400
      Re: OS startup goals and steps "wolfgang kern" <nowhere@never.at> - 2015-07-17 17:29 +0200

csiph-web