CSCI/CMPE 3334 Systems Programming David Egle Engr 3.296
Prerequisites CSCI/CMPE 2380 CSCI/CMPE 2333 Recommended – CSCI 2344 You will need to know about data structures such as linked lists and hashing CSCI/CMPE 2333 Since we will be creating an assembler, the knowledge of assembly language is important Recommended – CSCI 2344 The project is to be developed and run in the Linux system
Computer Software Application software Concerned with using a computer to solve (create?) a problem Focus is on the application (not the underlying hardware) Generally machine independent Examples: Document preparation, spreadsheets, databases, statistical analysis, games, etc.
Computer Software (cont’d) Systems software Concerned with supporting the use and operation of the computer system Provides tools for use by application software Strongly machine dependent Examples Operating systems, assemblers, compilers, loaders/linkers, debuggers
System Software Without system software all programming would be done in machine code application programs would need to directly use hardware resources (I/O devices, storage, memory) much of programmers time spent on program preparation and translation (and on finding effective ways to use hardware)
Programming environment All of the hardware and software in the environment used by the programmer A simple programming environment: Text editor for program preparation Assembler for translating programs to machine language Simple operating system consisting of I/O drivers and a file system This was typical of early timesharing systems
Improvements Use high level language Implies other changes though! Extensive library Automatic storage management Support for concurrency and exception handling Sharing of resources between applications More sophisticated operating systems Attempt to protect users from damage caused by program developers or other users
Additional features to simplify programmer’s job Library management Modify contents of libraries of functions Debugging tools Allow run-time errors to be interpreted in terms of source program rather than machine code Language specific text editors “Knows” about program syntax Finds syntax errors without leaving editor to compile program
Unifying framework Two distinct components of all programming environments Program preparation Program execution
Bare machine Program preparation Program execution Switches or buttons by which machine code and data is entered into the memory of the machine Program execution Hardware is directly manipulated CPU Peripherals Memory
More advanced systems Program preparation Program execution Text editors, assemblers, compilers, library managers, linkers, and loaders Program execution Operating system services, libraries of predefined functions, interpreters
History Earliest computers programmed in machine code They were so expensive that using them for such clerical jobs as language translation was viewed as a dangerous waste of scarce resources! Quickly realized the problems with this! Letting the computer spend a few minutes on the clerical job of assembling a program was cheaper than hand assembling it and then spending hours of computer time debugging it!
History 2 By 1960 Assembly language widely accepted High level languages being used FORTRAN COBOL LISP Algol Compilers and program preparation tools commonly integrated into operating systems
History 3 Late 60’s, early 70’s Saw separation of program preparation from program execution Users obtained editors, compilers, operating systems from different vendors Minicomputers and microcomputers followed history of mainframe programming Primitive early systems with language being part of the operating system Evolved to the more sophisticated systems of today
System Software and Architecture System programs closely related to architecture of machine on which they are to run The general design and logic of a system program usually does not depend on the target machine The actual implementation will So, we now consider the hardware aspect
Hardware considerations Need to have an understanding of the characteristics of the hardware when creating systems software Basic components of computer CPU Memory I/O devices (includes storage) Bus
CPU Instruction set Size and format of instructions Data format Most of characteristics differentiating systems are found here Instruction set Size and format of instructions Data format Addressing schemes Registers (size, number, usage) Execution states Interrupt handling Multiprocessor
Memory Size of storage cells Number of cells Access methods Instructions and data together or separate Protection schemes Cache handling
I/O and Bus I/O Bus Interface type (simple path, separate processor) Access method (direct program control, DMA, I/O processor) Bus Determines speed at which information is passed between components Bus size may influence programming – number of bits transferred at any one time Dedicated or multiplexed
Why use hypothetical computer Provides basis for study of systems software Avoids problems which arise when using “real” computer systems Cannot distinguish between “features” of systems software which are fundamental, and those which are the result of the idiosyncrasies of the hardware See last section of each chapter for examples of systems software on different platforms