Path: csiph.com!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: alt.os.development Subject: Re: OS startup goals and steps Date: Wed, 15 Jul 2015 04:00:53 -0400 Organization: Aioe.org NNTP Server Lines: 105 Message-ID: References: NNTP-Posting-Host: n4wpt9zq8xR26Ttf9mo2BA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.16 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: aioe.org alt.os.development:8383 On Tue, 14 Jul 2015 05:35:10 -0400, James Harris wrote: > 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 Well, Ben and you are logging to files. My OS only went as far as displaying output to the screen. You can pack quite a bit of info onto the screen as long as you don't need the screen for user display, i.e., during development. > Goal 2. Start multitasking so that other init can be concurrent So, just jump right into it? ... > Goal 3. Interact with the user (i.e. the OS is ready for use) So, is this minimal, i.e., just keyboard and console, maybe mouse, or everything available? > 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 Why "temporary" memory management? You've loaded the OS into memory. Or, is this part of the bootloader? I see these as being part of the OS proper. Why do you need to save what is already on the screen? ... You have BIOS calls below. Any BIOS calls here for VGA or VESA modes? > - 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 With one exception, I expect the bootloader to do the steps from "PC arch..." through to and including "Enter OS mode...". I expect the OS to do memory management and thereafter to 2. Also, I'd expect the OS to access the RTC for date and time, not what I view as the "bootloader." I'm not sure what info you'd really need from Int 15h, AH=C0h. AIR, it was mostly for obsoleted machines. Hide the text mode cursor? ... Clear screen? > - 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 OS stuff. So, ISTM, you have OS stuff to 1, bootloader stuff to non-temporary C memory management, OS stuff to 2, and more OS stuff to 3, except for the RTC in the "bootloader" section. Rod Pemberton