Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword or section
Like this
62Activity

Table Of Contents

Chapter 1, Introduction
Overview
What This Book Is About
Who Should Use This Book
My Basic Design Goals (yours may vary)
A Brief Description of MMURTL
Chapter 2, General Discussion and Background
Where Does One Begin?
The Chicken and the Egg
A Starting Point
The Critical Path
Working Attitude
CPU Time
Cooperative Multitasking
Scheduling Techniques
Simple Cooperative Queuing
Prioritized Cooperative Scheduling
Variable Time Slicing
Other Scheduling Factors
Interrupt Handling
Messaging and Tasks
Synchronization
Semaphores
Pipes
Messages
Request()
Respond()
Reentrancy Issues
Interrupt Latency
Memory Management Issues
Chapter 5, Memory Management
Introduction
Basic Terms
Memory Model
Simple Flat Memory
Paged Flat Memory
Demand-Paged Flat Memory
Virtual Paged Memory
Demand Paged Virtual Memory
Demand-Paged Memory Management
Segmented Memory
Memory Management
Tracking Linear Memory Allocation
Basic Memory Allocation Unit
Linked List Management
Memory Management With Tables
Tracking Physical Memory
Memory Protection
An Intel Based Memory Management Implementation
How MMURTL Uses Paging
Chapter 6, Hardware Interface
Hardware Isolation
The CPU
The Bus Structure
Serial I/O
Parallel I/O
Block-Oriented Devices
Keyboard
Video
Direct Memory Access (DMA)
Timers
Priority Interrupt Controller Unit (PICU)
Chapter 7, OS Initialization
Boot ROM
The Boot Sector
Operating System Boot Image
Other Boot Options
Basic Hardware Initialization
Static Tables and Structures
Initialization of Task Management
Initialization of Memory
Dynamic Tables and Structures
Chapter 8, Programming Interfaces
Application Programming Interface
Mechanical Details
Portability Considerations
Error Handling and Reporting
Systems Programming Interface
Internal Cooperation
Device Driver Interfaces
A Device-Driver Interface Example
Announcing the Driver to the OS
A Call to the driver
Chapter 9, Application Programming
Terminology
Understanding 32-BIT Software
Table 9.1 - Memory Alignment
Operating System Calling Conventions
Stack Usage
Table 9.2 - Basic Memory Map
Operating System Protection
Application Messaging
Job Control Block
Basic Keyboard
Basic Video
Table 9.3 - Foreground Colors (Low nibble)
Table 9.4 - Background Colors (High nibble)
Replacing Your Application
Chapter 10, Systems Programming
Writing Message-Based System Services
Initializing Your System Service
A Simple System Service Example
Listing 10.1 - A System Service
The Request Block
Items In the Request Block
The Service Code
Caller Information in a Request
Asynchronous Services
System Service Error Handling
Writing Device Drivers
Device Driver Theory
Building Device Drivers
How Callers Reach Your Driver
Device Driver Setup and Installation
System Resources For Device Drivers
Interrupts
Direct Memory Access Device (DMA)
Timer Facilities
Message Facilities for Device Drivers
Detailed Device Interface Specification
Device Control Block Setup and Use
Table 10.1-. Device control block definition
Standard Device Call Definitions
DeviceOp Function Implementation
DeviceStat Function Implementation
DeviceInit Function Implementation
Initializing Your Driver
OS Functions for Device Drivers
Standard Device Error Codes
Chapter 11, The Monitor Program
Active Job (Video & keyboard)
Initial Jobs
Listing 11.1. Sample Initial.Job file
Monitor Function Keys
Table 11.1. Monitor Function Keys
Monitor Program Theory
Performance Monitoring
Listing 11.2.Monitor program source listing
Chapter 12, Debugger
Using the Debugger
Entering the Debugger
Exiting the Debugger
Debugger Display
Debugger Function Keys
Debugging Your Application
Debugger Theory
Table 12.1.Processor exceptions
Chapter 13, Keyboard Service
Available Services
Table 13.1.Available Keyboard Services
Read Keyboard
Notify On Global Keys
Cancel Notify On Global Keys
Key codes and Status
Alpha-Numeric Key Values
Lock-State Byte (third byte)
Table 13.3 - Lock State Bits
Key Codes
Table 13.4 - .Keys Values
Function Strip Key Codes
Numeric Pad Key Codes
Table 13.6 - Numeric Pad Key Codes
Your Keyboard Implementation
Chapter 14, The File System Service
File Specifications
Network File Request Routing
File Handles
File Open Modes
File Access Type
Block Mode
Stream Mode
Logical File Address
File System Requests
Listing 14.1 - Openfile request in C
Table 14.1 - File System Service Codes
Procedural Interfaces
Device Access Through the File System
Table 14.2 - Device Stream Access
File System Functions in Detail
OpenFile
ReadBlock
WriteBlock
ReadBytes
WriteBytes
GetFileLFA
SetFileLFA
GetFileSize
SetFileSize
CreateFile
RenameFile
DeleteFile
CreateDirectory
DeleteDirectory
GetDirSector
File System Theory
Internal File System Structures
File Control Blocks
File User Blocks
FAT Buffers
File Operations
Read
Write
Chapter 15, API Specification
Public Calls
Parameters to Calls (Args)
Table 15.1 - Size and Type Prefixes
Table 15.2 - Additional Prefixes
Table1 5.3 - Compound Prefixes
Alphabetical Call Listing
AddCallGate
AddIDTGate
Alarm
AliasMem
AllocDMAPage
AllocExch
AllocPage
Beep
Chain
CheckMsg
Compare
CompareNCS
CopyData
CopyDataR
DeAliasMem
DeAllocExch
DeAllocPage
DeviceOp
DMASetUp
GetCmdLine
GetDMACount
GetJobNum
GetPhyAdd
GetVidChar
RD (Remove Directory)
Rename (Rename a file)
Run (Execute a .RUN file)
Type (View a text file on the screen)
External Commands
Commands.CLI File
Global "Hot Keys"
CLI Source Listing
Listing 16.1.CLI Source Code Listing Ver. 1.0
A Simple Editor
Editor Screen
Editor Commands
Table 16.1 - File Management and General Commands
Table 16.2 - Cursor and Screen Management Commands
Listing 16.2.Editor Source Code
DumbTerm
Listing 16.3 - DumbTerm source code
Print
Listing 16.4.Print source code
System Service Example
Service.C Listing
Listing 16.5 - Simple Service Source Code
TestSvc.C Listing
Listing 16.6 - TestSvc.C
Chapter 17, Introduction to the Source Code
Comments In the Code
Calling Conventions
Organization
Building MMURTL
Listing 17.1 – Assembler Template File
Using Pieces of MMURTL in Your OS
Using Pieces of MMURTL in Other Projects
Chapter 18, The Kernel
Naming Conventions
Kernel Data
Listing 18.1.Kernel data segment source
Local Kernel Helper Functions
enQueueMsg
Listing 18.2.Queueing for messages at an exchange
deQueueMsg
Listing 18.3.De-queueing a message from an exchange
deQueueTSS
Listing 18.4.De-queueing a task from an exchange
enQueueRdy
Listing 18.5.Adding a task to the ready queue
deQueueRdy
Listing 18.6.De-queueing the highest priority task
ChkRdyQ
Internal Public Helper Functions
RemoveRdyJob
Listing 18.9.Finding the owner of an exchange
SetExchOwner
Listing 18.10.Changing the owner of an exchange
SendAbort
Public Kernel Functions
Listing 18.12.Request kernel primitive code
Listing 18.13.Respond kernel primitive code
MoveRequest()
SendMsg()
ISendMsg()
Listing 18.16.IsendMsg kernel primitive code
WaitMsg()
CheckMsg()
Listing 18.18 -CheckMsg kernel primitive code
NewTask()
AllocExch()
DeAllocExch()
GetTSSExch()
Listing 18.23.GetTSS exchange code
SetPriority()
Listing 18.24.Set priority code
Chapter 19, Memory Management Code
Memory Management Data
Internal Code
InitMemMgmt
Listing 19.3.Continuation of memory management init
Listing 19.4.Continuation of memory management init
Listing 19.6.Allocation of memory management exchange
Listing 19.7.Finishing memory management initi
FindHiPage
Listing 19.8.Find highest physical page code
FindLoPage
Listing 19.9.Find lowest physical page code
MarkPage
Listing 19.10.Code to mark a physical page in use
Listing 19.11.Code to free a physical page ofr reuse
LinToPhy
FindRun
Listing 19.13.Code to find a free run of linear memory
AddRun
AddAliasRun
Listing 19.15.Adding an aliased run of linear memory
AddUserPT
Listing 19.16.Adding a page table for user memory
Listing 19.17.Adding an operating system page table
Public Memory Management Calls
AddGDTCallGate
Listing 19.18.Adding a call gate to the GDT
Listing 19.19.Adding entries to the IDT
AllocOSPage
Listing 19.20.Allocating a page of linear memory
Listing 19.22.Code to remove alias PTEs
Listing 19.23.Deallocating linear memory
QueryMemPages
Listing 19.24.Code to find number of free pages
Chapter 20, Timer Management Source Code
Choosing a Standard Interval
Listing 20.1.Loop in timer ISR
Timer Data
Listing 20.2 - Data and constants for timer code
Timer Code
Listing 20.3 - External functions for timer code
The Timer Interrupt
Listing 20.4 - The timer interrupt service routine
Sleep()
Listing 20.5 - Code for the Sleep function
Alarm()
Listing 20.6 - Code for the Alarm function
KillAlarm()
Listing 20.7 - Code for the KillAlarm function
MicroDelay()
Listing 20.8 - Code for the MicrDelay function
GetCMOSTime()
GetCMOSDate()
Listing 20.10 - Code to read the CMOS date
GetTimerTick()
Listing 20.11.Code to return the timer tick
Beep_Work()
Listing 20.12.Helper function for Beep() and Tone()
BEEP_Work:
Beep()
Listing 20.13.Code to produce a beep
Tone()
Listing 20.14 - Code to produce a tone
Chapter 21, Initialization Code
OS Global Data
Listing 21.1 - Main Operating System Data
Listing 21.5 - End of Initialization Code
Listing 21.6 - Initialization Subroutines
Listing 21.7 - Initialize call gates amd the IDT
Listing 22.1 - Job Management Subroutines
Job Management Listing
Chapter 23, Debugger Code
Debugger Interrupt Procedure
Listing 23.1 - Exception Handlers for Entering Debugger
Chapter 24, Selected Device Driver Code
IDE Disk Device Driver
Listing 24.5 - Continuation of IDE Driver Code (code)
The RS-232 Asynchronous Device Driver
Listing 24.7 - RS-232.h Header File
Keyboard Translation
Reading the Final Buffer
Listing 25.4.Read Keyboard Buffer Code
The Keyboard Service
Listing 25.5.Keyboard system service code
Keyboard Procedural Interface
Listing 25.6 - Code for Blocking Read Keyboard Call
Debugger Keyboard
Keyboard Hardware Set Up
Listing 25.8 - Code to Initialize the Keyboard Hardware
Keyboard Service Initialization
Listing 25.9 - Keyboard Service Initialization
Hardware Helpers
Listing 25.10 - Low-level Keyboard Control Code
Chapter 26, Video Code
Virtual Video Concept
VGA Text Video
The Video Code
Listing 26.1.Video constants and data
Listing 26.2 - Code to Initialize Video
Listing 26.3 - Code to Set the Video Owner
Listing 26.4 - Code to set Normal Video Attribute
Listing 26.5 - Code to get the Normal Video Attribute
Listing 26.6 - Code to Get the Current Video Owner
Listing 26.7 - Code to Clear the Screen
Listing 26.8 - Code for TTY Stream Output to Screen
Listing 26.9.Code to Screen Video Attributes
Listing 26.11.Code to Get a Character and Attribute
Listing 26.12.Code to Scroll an Area of the Screen
Listing 26.14.Code to Set Cursor Position
Listing 26.15.Code to Return Current Cursor Position
Listing 26.16 - Code to Edit a Line on the Screen
Relating MMURTL’s Video Code to Your Operating System
Chapter 27, File System Code
How MMURTL Handles FAT
Physical (Absolute) Sector Numbers
Hidden Sectors
Logical Block Address (LBA)
MS-DOS Boot Sector
File System Initialization
File System Listing
Listing 27.1 - MS-DOS FAT-Compatible File System Code
Chapter 28, DASM; A 32-Bit Intel-Based Assembler
DASM Concepts
Using DASM
Application Template File
Listing 28.1 - Simple Application Template File
Listing 28.2 - A More Complicated Template File
Command Line Options
Dynamic Link Libraries
Device Drivers
DASM Source Files
Local (Non-Public) Declarations
DASM Program Structure
DOT Commands
DASM versus DOS Assemblers
DASM Addressing Modes
Table 28.1 - .Specifying Memory Operands
Storage Declarations
DB (Define Byte)
DW (Define Word)
DD (Define Double Word)
DF (Define Far Word)
DASM Peculiar Syntax
PUBLIC Declarations
EXTRN Declarations
Labels and Address
Segment and Instruction Prefixes
CALL and JUMP Addresses
386 Instruction Set
Table 28.2 - Supported Instructions
Executable File Format
Table 28.3 - Tag Usage
Tag Descriptions
Error Codes from DASM
Your Own Assembler?
Variable Length Argument Lists
Interrupt Functions
Supported C Language Features
Library Header File Access
Limitations (compared to ANSI)
Structure Limitations
Far External Functions
Type Conversion and Pointers
Initialization of Static Variables
Other Implementation Dependent Information
Using CM32
Library Code Examples
Listing 29.2 - Standard file I/O for MMURTL
Listing 29.3 - Standard String Functions for MMURTL
0 of .
Results for:
No results containing your search query
P. 1
Developing Your Own 32-Bit Operating System (MMURTL)

Developing Your Own 32-Bit Operating System (MMURTL)

Ratings:

4.33

(3)
|Views: 3,170 |Likes:
Published by Vivek Vaidyanathan

More info:

Published by: Vivek Vaidyanathan on Dec 03, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

05/09/2014

pdf

text

original

You're Reading a Free Preview
Pages 14 to 159 are not shown in this preview.
You're Reading a Free Preview
Pages 173 to 242 are not shown in this preview.
You're Reading a Free Preview
Pages 256 to 412 are not shown in this preview.
You're Reading a Free Preview
Pages 426 to 512 are not shown in this preview.
You're Reading a Free Preview
Pages 526 to 682 are not shown in this preview.

Activity (62)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Ferdi Tekin liked this
Andra Gabriela liked this
scribd113 liked this
mctylr liked this
Dumitru Marian liked this
Claudio Russo liked this
Isaek Isberabah liked this

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->