1 / 51

A news feed window From my phone 8/24/19 Not tech-specific Not a query about cybersecurity

A news feed window From my phone 8/24/19 Not tech-specific Not a query about cybersecurity. Unifying concepts which will help us build a mental model o f the components and how they interact. The file and folders GUI metaphor, and how it relates to command line syntax

vanessaa
Download Presentation

A news feed window From my phone 8/24/19 Not tech-specific Not a query about cybersecurity

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A news feed window From my phone 8/24/19 Not tech-specific Not a query about cybersecurity

  2. Unifying concepts which will help us build a mental model of the components and how they interact • The file and folders GUI metaphor, and how it relates to command line syntax • A file is a stream of bytes, and everything is represented as a file • Files have meta-level information • The command line interface is alive and well • Files are arranged in trees (graphs) • A ready-to-run program is a process • The main interactive interface to the machine is called a shell • OS structure – sections 1, 2, 3 of the manual

  3. Unifying concepts • A bit is a 1 or a 0 • A byte is a grouping of 8 bits • A file is a stream of bytes • Everything is a file • Files are arranged in trees (graphs)

  4. computer processes in Files containing code or data memory hierarchy Humans via keyboard, mouse, joystick… Programs running here or across the network Static files code, data sensors out Humans via HID’s: display, Speakers, printers, actuators Other programs running here or elsewhere files

  5. Ok, not the greatest graphic… but • A bit is a 1 or a 0 • A byte is a grouping of 8 bits • A file is a stream of bytes • Everything is a file Computers can read/write/manipulate 1’s and 0’s at an insanely fast rate using insanely tiny and dense storage devices + HID’s which operate beneath the level of human perception

  6. Computers + I/O devices computer – something which implements a Turing Machine and which runs one or more stored programs I/O devices - something to assist in getting information to the computer/program + something to assist in displaying the information from it Human Interface Devices – when a human is the source/target of the I/O; push button, keyboard, mouse, display, speaker… Keyboard, terminal – the “command line” interface

  7. HID’s can operate beneath the ability of human perception That car driving down the road is really just a video of a car driving down the road That video is really just a series of images flashed in front of you Each image is really just a series of pixels too close together to perceived individually Each white pixel is really a red, green, and blue dot very close to one another https://www.youtube.com/watch?v=hEbIWPArai4 https://www.google.com/search?q=highway+led+signs

  8. I/O can also come from/go to nonhuman sources The output of one program can provide the input to another and vice versa String str; printf(“Enter some text> “); str = readLine(); //program blocks here waiting for a user to type something Enter some text>

  9. printToSocket(“hello”); Or: string str; str = readSocket(); //program blocked waiting for a program on another computer to send something H e l l o network

  10. Input can come from the environment via sensors, or output can go to the environment via actuators

  11. GPS

  12. Analog pitch, roll, yaw on x,y,z

  13. Pressure sensor, analog

  14. 3-axis accelerometer using I2C

  15. Temperature sensor https://www.nxp.com/docs/en/data-sheet/LM75A.pdf

  16. So we have computers, capable of pushing 1’s and 0’s around - a phenomenal number of them, at a phenomenal rate where everything – all the data, and the programs as well – is stored as 1’s and 0’s according to schemes almost exclusively implemented in software HID’s, which often need phenomenal amounts of 1’s and 0’s delivered at a phenomenal rate to maintain their illusion

  17. Programming languages give you mental crutches myCharVariable = ‘A’; // you may think you are putting a capital letter ‘A’ into the variable, // but really you are setting the 8 bits of the variable to be // 0 1 0 0 0 0 0 1 // // (assuming a 1 byte C-like character type, and ASCII encoding

  18. char array[10][20]; array[3][5] = ‘B’; //you may think there is some two dimensional structure in //memory and you’re putting a ‘B’ 4 columns over and 6 rows //down, but really the multidimensional array notion and bracket [] //subscripting is a mental crutch to avoid having to linearize your //thinking… and the ‘B’ is really: 0 1 0 0 0 0 1 0

  19. Byte level model of the components • files • code data abstractions • text keyboard • html terminal • video process info tree • audio • images • for human consumption • for other code • HID’s interface with humans, operating beneath their perception • Files are streams of bytes with meta-information attached • Computers push bits around at incredible speeds and densities

  20. Why this level of model? File operations are thus consistent across the whole game (almost)

  21. Not everything is a laptop Computers may run a single program, or be able to run a variety of programs The memory where a program resides may or may not be designed to be writable at run time A computer program may or may not interface with humans, the environment, both, neither Computers may or may not be connected to a network A network may or may not be wired

  22. But, the concepts still apply

  23. Somebody can walk in and just physically take/destroy/reboot/reimage your computers/storage/routers https://www.youtube.com/watch?v=rnmcRTnTNC8

  24. Sitting at home I take control of a computer across the world working only over the network I achieve super-user status and run whatever programs I like Sort of a hacker holy grail By the size of botnets for hire, apparently not all that impossible to do

  25. A thermostat for climate control in a room has an embedded computer which runs only a thermostat program. It is not networked in any way and the memory which holds the program is not writable. Still, I discover that while I am changing the temperature down, if I simultaneously push both the heat and A/C buttons, the units shuts off and the thermostat blanks out. I deny service to someone by exploiting a bug in the software.

  26. Hardware advancements  embedded systems often run *nix are network connected follow the model https://www.youtube.com/watch?v=B8DjTcANBx0?t=120s

  27. Tricking people https://www.forbes.com/sites/billsinger/2012/05/15/feds-catch-their-illegal-limit-in-operation-phish-phry/#3b103d476265

  28. But not you, not me? https://howsecureismypassword.net/

  29. With such a broad landscape, heterogeneous, complex, and becoming more so, Where does our concern lie?

  30. CIA (isn’t that clever? words are more true when they rhyme) Confidentiality Integrity Availability

  31. Science is real, but not true, Math is true, but not real. - me Cave kids and quantum fields https://www.youtube.com/watch?v=zNVQfWC_evg

  32. A file is a stream of bytes, and everything is represented as a file to make things more tractable, “byte” is the first level of grouping of our 1’s and 0’s, It is a consumer facing term, and generally understood. hardware can function at the bit level, but also at the level of groups of bytes: 1-byte, 2-bytes, 4-bytes, 512-bytes 1 byte == 8 bits, each a 1 or a 0 1 1 0 0 0 1 0 0 ½ a byte == 4 bits is called a nibble

  33. 1 1 0 0 0 1 0 0 Digit position 7 6 5 4 3 2 1 0 Taken as a base B number, each place has the value B position 0 2 == 1 2 == 2 2 == 4 2 == 8 … etc 1 2 3

  34. 1 1 0 0 0 1 0 0 Place 128 64 32 16 8 4 2 1 So as a base 2 number, this is 16 + 2 + 1 == 19 Byte values range from 0 to 255

  35. Every file you have, whatever it represents, is just a stream of numbers, each between 0 and 255 If you want to store a character, a negative number, a color, an angle of rotation, anything, it has to have a canonical way of being mapped onto bytes The top level distinction, plants vs animals is data vs executable

  36. 1 1 0 0 0 1 0 0 Since base 10 and base 2 do not play together nicely We often use base 16 (hex(adecimal)) and sometimes base 8 (octal) 4 bits (a nibble) is a single hex digit 3 bits is a single octal digit

  37. Base k needs k symbols, Base 10 has these 10: base 2 has these 2: 9 7 2 0 1 6 3 4 5 8 0 1

  38. Hex, Base 16 has these 16: 0 1 2 3 4 5 6 7 8 9 a b c d e f

  39. Count in binary, octal, hex Add: 0 1 1 1 3E + 0 0 1 1 + 63 ------------ ------- 0xBADBEEF write in binary 0110 1111 write in hex, octal

  40. literals What is the output of the following code? inta,b,c; a = 3; b = (c = 4) + 1; System.out.printf(“a = %d\n", a); System.out.printf("b = %d\n", b) System.out.printf("c = %d\n", c);

  41. inta,b,c; a = 3; b = (c = 4) + 1; System.out.printf(“a = %d\n", a); System.out.printf("b = %d\n", b) System.out.printf("c = %d\n", c); a = 3 b = 5 c = 4

  42. What is the output of the following code? inta,b,c; a = 13; b = 013; c = 0x13; System.out.printf(“a = %d\n", a); System.out.printf("b = %d\n", b) System.out.printf("c = %d\n", c);

  43. What is the output of the following code? inta,b,c; a = 13; b = 013; c = 0x13; System.out.printf(“a = %d\n", a); System.out.printf("b = %d\n", b) System.out.printf("c = %d\n", c); a = 13 b = 11 c = 19

  44. ASCII encoded vs binary int a; //(Java) how many bytes is ‘a’ ? a = 27; //and what are they exactly? System.out.printf(“%d\n”, a); //how many bytes of output? //and what are they exactly? //what if a = 127?

More Related