Category:I600 Introduction to Computers and Informatics: Difference between revisions

From ICO wiki
Jump to navigationJump to search
Lvosandi (talk | contribs)
Lvosandi (talk | contribs)
Line 93: Line 93:
[https://docs.google.com/presentation/d/1xDL27k3z_0I-IKzdjKkwhOhBrg0aOnM0w0u1zDwaEWY/ kernels].
[https://docs.google.com/presentation/d/1xDL27k3z_0I-IKzdjKkwhOhBrg0aOnM0w0u1zDwaEWY/ kernels].


Jargon: bootloader, kernel, process, context switch, x86 real/protected mode, paged virtual memory, swap/pagefile, kernelspace/supervisor mode, userspace, hypervisor mode.
Jargon: bootloader, kernel, process, context switch, x86 real/protected mode, paged virtual memory, swap/pagefile, [https://en.wikipedia.org/wiki/User_space kernelspace/supervisor mode, userspace], [https://en.wikipedia.org/wiki/Protection_ring#Hypervisor_mode hypervisor mode].
 
Potential exam questions:
 
* Explain step by step how operating system is booted up, see slides for flowchart.
* What are the main differences between [https://en.wikipedia.org/wiki/Real_mode real mode] and [https://en.wikipedia.org/wiki/Protected_mode protected mode] of x86-based processor?
* What happens during context switch?
* What is the purpose of [https://en.wikipedia.org/wiki/Virtual_memory paged virtual memory]?
 


Security section: [https://en.wikipedia.org/wiki/DMA_attack DMA attack], [http://www.outsidaz.org/blog/2007/10/22/resetting-root-password-via-grubkernel-boot-options/ editing GRUB entries to gain root shell] without password prompt, [http://www.theinquirer.net/inquirer/news/2421402/serious-intel-cpu-security-exploit-spotted-in-old-x86-chips 20 years old security exploit in x86 processors].
Security section: [https://en.wikipedia.org/wiki/DMA_attack DMA attack], [http://www.outsidaz.org/blog/2007/10/22/resetting-root-password-via-grubkernel-boot-options/ editing GRUB entries to gain root shell] without password prompt, [http://www.theinquirer.net/inquirer/news/2421402/serious-intel-cpu-security-exploit-spotted-in-old-x86-chips 20 years old security exploit in x86 processors].

Revision as of 18:56, 21 September 2015

In this course we'll give an introduction to variety of topics from hardware to software. The course will follow roughly the same structure as Computer Science 101 at Stanford University with more hands-on approach. This course substitutes Estonian courses I100 Sissejuhatus informaatikasse and I201 Arvutid.

Monday lectures will cover more theoretical stuff; Thursday workshops are for getting started with new topics; the homework assignments connect theoretical with practice and Tuesday sessions are for follow up, asking/answering questions and presenting homework. Bring your laptops for Tuesday and Thursday sessions.


Course credits: 6 ECTS

Lecturer: Lauri Võsandi

E-mail: lauri [donut] vosandi [plus] i600 [ät] gmail [dotchka] com


Grading

Grade mapping:

  • 0-50 points, fail
  • 51-60 points, pass 1
  • 61-70 points, satisfactory 2
  • 71-80 points, average 3
  • 81-90 points, good 4
  • 91-100 points, very good 5

Grading is split between theory and practice

  • Exam of 50 points, preparation in lectures and general discussion in workshops.
  • Assignments, see instructions and points below.
  • Extra points for improving quality of wiki articles and extracurricular work, see points below.

Lecture: Computer hardware

Jargon: CPU, RAM, ROM, HDD, SSD, PCI, PCI Express, USB 2.0, USB 3.0, VGA, HDMI, DVI, LCD, TFT, LED, OLED, AMOLED, CRT, PWM

Lecture recording #1

Lecture recording #2 starting 12:30

Lecture slides Random access memory, permanent storage, buses, input devices, display technologies, networking

Potential exam questions:

Security section: Hacking SD cards

Assignments:

Lecture: Storage abstractions

In this lecture we'll talk about permanent storage abstractions: block device, disk, partition, file system, directory/folder, file, journaling, FAT32, NTFS, ext4, HFS+

Lecture slides

Lecture recording starts at 47:50.

Lecture: Bootloaders, kernels

In this lecture we'll discuss how a computer boots and how an operating system kernel is loaded.


Lecture recording, first half we'll discuss about first assignment about investigating PC hardware, slides start at 43:40.

Lecture slides: bootloaders, kernels.

Jargon: bootloader, kernel, process, context switch, x86 real/protected mode, paged virtual memory, swap/pagefile, kernelspace/supervisor mode, userspace, hypervisor mode.

Potential exam questions:

  • Explain step by step how operating system is booted up, see slides for flowchart.
  • What are the main differences between real mode and protected mode of x86-based processor?
  • What happens during context switch?
  • What is the purpose of paged virtual memory?


Security section: DMA attack, editing GRUB entries to gain root shell without password prompt, 20 years old security exploit in x86 processors.

Lecture: Libraries, frameworks

Jargon: framework, library


Security section: HTTP.sys bug crashes IIS web servers, OpenSSL bug Heartbleed.


Lecture: Introduction to code execution

In this lecture we'll talk about writing and running code.

Potential exam questions:

Assignments:


Lecture: Data encoding

In this lecture we'll talk about bits, bytes, integers, strings, pixels, audio encodings, video encoding etc.

  • What is bit? Nibble? Byte? Word?
  • What is quantization in terms of signal processing?
  • How are integers stored in binary? What integer range can be described using n bits? How many bits are required to describe integer range from n .. m.
  • How are single precision and double precision floating point numbers stored in binary according to IEEE754 standard?
  • What is the difference between CMYK and RGB color models? How are YUV, HSV and HSL colorspaces related to RGB? What are sRGB and YCbCr and where are they used?
  • How is data encoded on audio CD-s?
  • What is sampling rate? What is bit depth? What is resolution?
  • What is bitrate?
  • What is lossy/lossless compression?
  • What is JPEG suitable for? Is JPEG lossy or lossless compression method?
  • What is PNG suitable for? Does PNG support compression?
  • How are time domain and frequency domain related in terms of signal processing? What is Fourier transform and where it is applied?

Jargon: 44.1kHz sampling rate, 16-bit audio, RGB565 pixel format, RGB888 pixel format


Lecture: Introduction to Y

Potential exam questions:

In this lecture we'll talk about Y

Lecture: Introduction to Boole algebra

Assignments:


Assignment: Investigating PC hardware

Goal: Get familiar with your laptop hardware. Get out of the comfort zone of your primary operating system and try out other operating systems. Learn about hardware virtualization.

Deadline: 16. September

Credits: 5 points plus extra point for being extra thorough about interpreting what you see.

Use what you learned in Getting started with Ubuntu workshop:

  • Read the instructions before you act.
  • Place your preferred ISO image to a memory stick using dd or Win32 Disk Imager and boot it on your personal laptop. You do not need to install Ubuntu on your harddisk, simply click Try Ubuntu once the operating system boots off the memory stick and carry out following tasks.
  • Open up terminal by pressing Ctrl-Alt-T.
  • Use lsb_release -a to check what operating system distribution you're running.
  • Use uname -sr to check what operating system kernel you're running.
  • Use cat /proc/cpuinfo and check processor information. What CPU model and how many cores your computer has?
  • Use arch to check what CPU architecture is being used by the operating system. Is it 32-bit or 64-bit?
  • Use cat /proc/meminfo to check memory usage. How much RAM your computer has?
  • Use lspci -t -v -nn to enumerate PCI and PCI Express devices, attempt to identify what is what.
  • Use lsusb and lsusb -t to enumerate USB devices, again attempt to identify what is what.
  • Use fdisk -l to enumerate disks and partitions. How big is your harddisk? How many and how big partitions it has?
  • Use lsblk to enumerate block devices.
  • Use xrandr to enumerate display outputs. What video output resolutions are available and which one is currently used?
  • Use cat /proc/asound/cards to check which audio devices are available.
  • Use dmidecode to see even more information about your computer.
  • Use ifconfig -a or ip addr list to list all network interfaces.
  • Use iwconfig or iw list to list all wireless network interfaces. Is your wireless network interface detected? If not take a guess why?
  • Use hcitool dev to list bluetooth host controller. Is your bluetooth device detected?
  • Use glxinfo to check what 3D rendering capabilities are available, is it hardware accelerated? (hint: is direct rendering enabled?)
  • What audio card is your machine using? What bus is it using?
  • What graphics controller is your machine using? What bus is it using?
  • What webcam is your machine using? What bus is it using?
  • What wired network chipset your computer has? What bus is it using?
  • What wireless network chipset your computer has? What bus is it using?
  • What Bluetooth device your computer has? What bus is it using?
  • Is there a cellular modem connected and how it's connected?
  • Boot the ISO image in VirtualBox and follow the same steps as above, what are the differences and why?
  • Answer to questions above and send it as plain text e-mail to Lauri, make sure you use the address supplied above with the course code, otherwise your mail is not searchable in my mailbox. Attach collected command outputs as plain text file, do not send .odt, .doc files, these are not readable on my smartphone. When answering to questions phrase the text in a way that is understandable out of context, so I don't have to open up wiki to understand what you're talking about.

Note that I can't expect you to install Ubuntu on your physical machine, but I can help if you want to do that. You should have Ubuntu ready to go in a virtual machine at least for subsequent sessions. We're using Ubuntu because it's widely used on servers and in the cloud, so any Ubuntu skills will definitely come handy in future. If you're already familiar with Linux, it's suggested to take a look at other interesting operating systems such as FreeBSD or OpenBSD. Take a look at Kali Linux if you're interested in penetration testing.

Assignment: Investigating embedded hardware

Background: Most of the smartphones nowadays are using SoC built around ARM processor. Raspberry Pi is an excellent piece of hardware to for checking out how an ARM-based machine looks like.

Goal: Get familiar with hardware ARM-based hardware.

Deadline: 23. September

Points: 4 points

Use what you learned in Getting started with Ubuntu and Getting started with Raspberry Pi workshops:

  • Read the instructions before you get busy.
  • Boot Raspbian on Raspberry Pi.
  • Use the commands described in previous assignment to examine the environment of Raspbian on Raspberry Pi. What are the major differences compares to your laptop and virtual machine?
  • What buses is Raspberry Pi making use of?
  • What filesystems is Raspbian making use of?
  • Answer to questions above and send it as e-mail to Lauri, make sure you use the address supplied above with the course code, otherwise your mail is not searchable in my mailbox. Attach collected command outputs as plain text file, do not send .odt, .doc files, these are not readable on a phone. When answering to questions phrase the text in a way that is understandable out of context, so it is not necessary to open up wiki to understand what you're talking about.

Assignment: Investigating LAMP

LAMP software bundle is consists of Linux-based OS, Apache web server, PHP programming language runtime and MySQL database. Most of the web applications on the Internet including Facebook are built on top of LAMP-styled software stack. Use a Raspberry Pi to set up WordPress, ownCloud or any well-known web application that makes use of a database. To make your life easier also set up SSH public key authentication.

Goal: Get familiar with LAMP stack. Get comfortable with (SSH) public key authentication.

Deadline: 30. September

Points: 4 points

Tasks:

  • Use SSH to connect to your Raspberry Pi over the network. If you're using Windows on your laptop use PuTTY to gain access to command line and WinSCP to copy files, otherwise simply boot Ubuntu in a virtual machine and use ssh pi@hostname to invoke commands and sftp://pi@hostname in the file browser to access filesystem.
  • Set up any of the web applications referenced above.
  • Demonstrate that the web application you installed works in next Tuesday session.
  • Optional: Set up SSH public key authentication to enos.itcollege.ee.
  • Optional: Set up public key authentication to your Raspberry Pi. Windows users might want to take a look at PuTTYgen instructions.


Assignment: X

  • In next session: Demonstrate that you can log in using SSH to enos.itcollege.ee using public key authentication (without password).


Assignment: Investigating compilers

Deadline: TBD

Use code for calculating Fibonacci series as an example input. You're encouraged to use any other code snippet you can handle.

int main() {
  int c;
  long int first = 1;
  long int second = 1;
  long int next;
  for (c = 0; c < 10; c++) {
    printf("%d ", first);
    next = first + second;
    first = second;
    second = next;
  }
}

Steps:

  • Install GNU Compiler Collection: apt-get install gcc
  • Store the code snippet in a file and compile it: gcc fibonacci.c -O fibonacci
  • Verify that the executable works: ./fibonacci
  • Install ARM cross-compiler: apt-get install gcc-arm-linux-gnueabihf
  • Compile ARM assembly of the code snippet: gcc -S fibonacci.s -O fibonacci.s
  • Recompile with different optimization levels: -Os, -O0, -O1, -O2 and -O3. What are the differences?
  • Comment the ARM assembly


Assignment: Investigating microcontrollers

In this assignment we use Arduino:

  • Install Arduino IDE on your personal machine.
  • Use analog input to measure distance using proximity sensor and map it to hue.
  • Use Atmega built-in functionality for generating PWM signals to drive RGB LED.
  • Use LCD1602 shield to display current values.
  • Use interrupts to read button presses


Assignment: Designing arithmetic-logic unit

In this assignment we use SN7400 chips to build a 4-bit arithmetic-logic unit. Form teams of 6. You'll be given 3x breadboards, 30x SN7400 chips, jumper cables, slide switches, LED-s, resistors. Use: breadboard to connect the components; four slide switches for operand A; four slide switches for operand B; four slide switches to select ALU operation mode and four LED-s as outputs. Make sure you protect LED-s with resistors.

Deadline: TBD

Points: 4 points

Assignment steps:

  • Considering 5V power supply, voltage drop of 1.8V on LED and maximum current of 20mA what is the minimum resistance for the protective resistor?
  • Each SN7400 contains four NAND gates. Use two SN7400-s to compose a full adder. Use four full adders to compose 4-bit carry-ripple adder. Verify your adder works.
  • Add switch for toggling between adding/subtracting, you can achieve this by inverting bits of operand B and carry in. Verify that addition and subtraction works as expected.
  • Add circuitry for calculating bitwise NAND and NOR operations on operand A and operand B.
  • Add 2:1 muxes to select between NAND and NOR.
  • Add 2:1 muxes to select between NAND/NOR output and adder/subtractor output.
  • Evaulate the cost of your design. Evaluate the energy consumption of your design?

Present your solution in Tuesday session.

Extra points

Here you can claim extra credit points for various tasks, this is mostly to improve the quality of wiki.itcollege.ee. Once you have taken care of the task insert your name in the end of the line with corresponding date.

This category currently contains no pages or media.