Giter Site home page Giter Site logo

katlyndah / csapp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bitwitch/csapp

0.0 0.0 0.0 624 KB

Computer Systems: A Programmer's Perspective

Shell 0.13% Perl 2.95% C 66.63% Tcl 5.63% Assembly 8.54% Makefile 0.87% HTML 0.69% Yacc 0.23% Lex 0.32% HCL 14.00% GDB 0.01%

csapp's Introduction

Computer Systems: A Programmer's Perspective 3rd edition

Here you can find all of the end of chapter problems in the csapp book, as well
as some practice problems and random experiments. This is mainly for me to
keep everything in one place as I am using multiple machines, but I made it
public so potentially someone else might get something out of it.

Building the Y86-64 simulators for Chapter 4

The simulator tools and documentation can be downloaded from this page
under Chapter 4: Processor Architecture

I had to fix a few things in order to get the simulator to build. I was
running this on Raspberry Pi OS, should be similar for other linux distros:

  1. Install flex
    sudo apt install flex
  2. Download and build Tcl
  3. Download and build Tk
    Both can be downloaded from here
  4. Update the outermost Makefile in the sim directory
    • enable GUI mode by uncommenting the line:
      GUIMODE=-DHAS_GUI
    • Point the linker to the tcl and tk libraries, for me this was:
      TKLIBS=-L/usr/local/lib -ltcl8.6 -ltk8.6
    • Point the compiler to the tcl and tk header files (tcl.h and tk.h).
      Also since tcl apparently deprecated some things after version 8.5,
      in order to build projects using some deprecated code, you have to
      #define USE_INTERP_RESULT before including tcl.h. This can be done
      via a compiler flag.
      TKINC=-D USE_INTERP_RESULT -isystem /usr/include/tcl8.6

Note on buggy behavior with simulator memory

I noticed that if you allocate some memory directly in Y86-64 and try to assign
an 8 byte hex value (specifying all 8 bytes explicitly), then the simulator
doesn't work properly. The memory contents viewer and the register display both
do not show correct values.

For example creating an array like this:

    .align 8
array:
    .quad 0x0123456789ABCDEF
    .quad 0x0123456789ABCDEF
    .quad 0x0123456789ABCDEF
    .quad 0x0123456789ABCDEF

I have only had success with small values like this:

    .align 8
array:
    .quad 0xA
    .quad 0xB
    .quad 0xC
    .quad 0xD

csapp's People

Contributors

bitwitch avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.