Skip to content

Commit 511aa61

Browse files
committed
improve description
1 parent a736efd commit 511aa61

9 files changed

Lines changed: 107 additions & 53 deletions

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
[![Build Status](https://travis-ci.org/cirosantilli/x86-assembly-cheat.svg?branch=master)](https://travis-ci.org/cirosantilli/x86-assembly-cheat)
44

5-
x86 userland minimal examples. Hundreds of runnable asserts. Linux focus for now, but highly OS portable. Containers (ELF), linking, calling conventions. System land at: [x86 Bare Metal Examples](https://github.com/cirosantilli/x86-bare-metal-examples)
5+
x86 userland minimal examples. Hundreds of runnable asserts. Containers (ELF), linking, calling conventions. System land cheat at: <https://github.com/cirosantilli/x86-bare-metal-examples>
66

77
1. [Getting started](getting-started.md)
88
1. Introduction
99
1. [How to learn](how-to-learn.md)
1010
1. [Instruction sets](instruction-sets.md)
1111
1. [Other architectures](other-architectures.md)
12+
1. [ARM](https://github.com/cirosantilli/arm-assembly-cheat)
1213
1. [RISC-V](risc-v.md)
14+
1. [Microcontrollers](microcontrollers.md)
1315
1. [RISC vs CISC](risc-vs-cisc.md)
1416
1. [Microcode](microcode.md)
1517
1. [System vs application programming](system-vs-application-programming.md)
@@ -21,10 +23,11 @@ x86 userland minimal examples. Hundreds of runnable asserts. Linux focus for now
2123
1. [Intel processor history](intel-processor-history.md)
2224
1. [Intel vs AT&T syntax](intel-vs-atet-syntax.md)
2325
1. [intel2gas](intel2gas.md)
24-
1. [CPU Optimizations](cpu-optimizations.md)
25-
1. [CPU bugs](cpu-bugs.md)
2626
1. [Implementations](implementations.md)
2727
1. [Extensions](extensions.md)
28+
1. [CPU Hardware design](cpu-hardware-design.md)
29+
1. [CPU Optimizations](cpu-optimizations.md)
30+
1. [CPU bugs](cpu-bugs.md)
2831
1. [IA-32](ia-32.md)
2932
1. [main.asm](main.asm)
3033
1. [hello_world.asm](hello_world.asm)

bibliography.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,11 @@
8888

8989
Binutils cannot be used as a library to disassemble? Sad.
9090

91+
## Cool projects
92+
93+
Useless but cool and educational:
94+
95+
- <https://github.com/flouthoc/calc.asm>
96+
9197
[Itanium C++ ABI]: http://mentorembedded.github.io/cxx-abi/abi.html
9298
[System V ABI AMD64]: http://www.x86-64.org/documentation_folder/abi-0.99.pdf

cpu-hardware-design.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# CPU hardware design
2+
3+
- <http://electronics.stackexchange.com/questions/122050/what-limits-cpu-speed>
4+
- <http://cs.stackexchange.com/questions/22589/why-does-a-processor-have-32-registers>
5+
- <http://electronics.stackexchange.com/questions/158053/what-components-or-circuitry-exist-that-can-provide-extremely-high-speed-accura>

gas/altmacro.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ ENTRY
6666
6767
# Percent
6868
69-
Appears to work only on argumetns passed or their default values.
69+
Appears to work only on arguments passed or their default values.
7070
*/
7171

7272
.macro PERCENT x

implementations.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,7 @@ Intel and AMD have cross-licensing agreements:
3131
- http://www.anandtech.com/show/2873
3232
- http://www.eetimes.com/document.asp?doc_id=1129690
3333
- Interview with W. Jerry Sanders http://silicongenesis.stanford.edu/transcripts/sanders.htm
34+
35+
## Open implementations
36+
37+
<https://github.com/marmolejo/zet> TODO legal?

lib/driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
int PRE_CDECL asm_main(void) POST_CDECL;
1111

1212
int main(void) {
13-
return asm_main();
13+
return asm_main();
1414
}

microcontrollers.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Microcontrollers
2+
3+
## Vs microprocessor
4+
5+
There is a spectrum, so difficult to say.
6+
7+
Microcontrollers are small SoCs... memory is inside chip.
8+
9+
They have IO dedicated pins.
10+
11+
TODO: response time is smaller.
12+
13+
TODO: most have predictable instruction times, and are better for hard real time.
14+
15+
TODO: the latency between signal and result is smaller
16+
17+
TODO: often programmed to run on bare metal, while microprocessors are more often programmed to run on top of an OS (e.g. Linux). But there are also OSes for microcontrollers, mostly real time ones: <http://www.embedded.com/design/operating-systems/4425751/Comparing-microcontroller-real-time-operating-systems>, e.g. QNX. Those OSes can even implement the POSIX C API.
18+
19+
Microcontrollers can have either internal or external clock sources: <http://electronics.stackexchange.com/questions/15455/internal-or-external-oscillator> TODO CPUs?
20+
21+
<http://electronics.stackexchange.com/questions/1092/whats-the-difference-between-a-microcontroller-and-a-microprocessor>

other-architectures.md

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,6 @@ This tutorial focuses only on the x86 architecture families.
44

55
Here are some other popular architectures which you should have in mind as well:
66

7-
## ARM
8-
9-
<https://en.wikipedia.org/wiki/ARM_architecture>
10-
11-
Great majority of mobile phones.
12-
13-
Low power consumption.
14-
15-
RISC.
16-
17-
armv7 is a version of arm that added floating point operations: <http://stackoverflow.com/questions/7080525/why-use-armeabi-v7a-code-over-armeabi-code>
18-
19-
### Open implementations
20-
21-
<https://en.wikipedia.org/wiki/Amber_%28processor_core%29> TODO how does it compare in performance / cost?
22-
23-
ARM has already sued people in the past for implementing ARM ISA: http://www.eetimes.com/author.asp?section_id=36&doc_id=1287452 so not open.
24-
25-
<http://semiengineering.com/an-alternative-to-x86-arm-architectures/>:
26-
27-
> Asanovic joked that the shortest unit of time is not the moment between a traffic light turning green in New York City and the cab driver behind the first vehicle blowing the horn; it’s someone announcing that they have created an open-source, ARM-compatible core and receiving a “cease and desist” letter from a law firm representing ARM.
28-
297
## PowerPC
308

319
<https://en.wikipedia.org/wiki/PowerPC>
@@ -48,11 +26,14 @@ Officially supported on Android.
4826

4927
<http://www.androidauthority.com/nintendo-64-android-l-microcontrollers-story-mips-538596/>
5028

29+
Lextra story: <http://probell.com/lexra/> It is not possible to patent an entire ISA as there is too much prior art, but companies patent instead specific novel instructions, and the compatibility break kills off reimplementors.
30+
5131
### Open implementations
5232

53-
Seems closed?
33+
Seems closed? TODO legal?
5434

55-
Open implementation: <https://brej.org/yellow_star/> TODO legal?
35+
- <https://brej.org/yellow_star/>
36+
- <https://github.com/jmahler/mips-cpu>
5637

5738
## SPARC
5839

risc-v.md

Lines changed: 58 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44

55
Most promising open ;
66

7-
They have a full working software toolchain:
8-
9-
- <https://github.com/riscv/riscv-linux> GCC
10-
- <https://github.com/riscv/riscv-tools>
11-
- <http://riscv.org/software-tools/riscv-qemu/>
12-
137
Created in 2010. BSD license.
148

159
Userspace fixed in 2014, but kernel land not yet as of 2016. So the Linux port may have to change.
@@ -22,27 +16,21 @@ TODO: any real hardware produced besides FPGA?
2216

2317
Debian port: <https://wiki.debian.org/RISC-V>
2418

25-
## Rocket
26-
27-
<https://github.com/ucb-bar/rocket-chip>
28-
29-
Written in Chisel, which is Scala based: <https://github.com/ucb-bar/chisel>
30-
31-
By Berkley people.
32-
33-
2015 presentation by Yunsup Lee <https://www.youtube.com/watch?v=Ir3h3qWcNlg>
19+
## Software toolchain
3420

35-
A single source coce + some input parameters can generate:
21+
- <https://github.com/riscv/riscv-linux> GCC
22+
- <https://github.com/riscv/riscv-tools>
23+
- <http://riscv.org/software-tools/riscv-qemu/>
3624

37-
- C++ simulator code
38-
- FPGA Verilog
39-
- ASIC Verilog
25+
Emulators: Spike is dedicated for this project:
4026

41-
TODO: any plans for silicon production?
27+
- <http://stackoverflow.com/questions/32881106/riscv-qemu-scall-versus-spike-ecall>
28+
- <http://52.32.189.224/angel-simulator/> JavaScript!
4229

43-
http://www.lowrisc.org/docs/untether-v0.2/
30+
There are two types of simulation you can do:
4431

45-
2016 thesis on it: <http://www.eecs.berkeley.edu/~waterman/papers/phd-thesis.pdf>
32+
- functional: assembly comes in and is emulated. Faster. Does not use the hardware implementation at all, and therefore does not test it: what is does test are software tools like compiler and kernel ports. May or not be cycle accurate as well, with performance hit if yes.
33+
- RTL: the entire hardware is emulated. Slower, but more precise. You need the underlying hardware implementation. Always cycle accurate.
4634

4735
## lowRISC
4836

@@ -53,6 +41,8 @@ RISC-V ASIC and FPGA implementation.
5341

5442
RISC-V is only the API.
5543

44+
Uses Rocket, but one major innovation is that it includes IO devices, while Rocket needed an ARM IP for that: <https://youtu.be/9BU5yNeyI5k?t=91>
45+
5646
Mass production planned for 2017: <http://www.lowrisc.org/about/>
5747

5848
By Cambridge people.
@@ -63,9 +53,37 @@ Google summer of code projects in 2016: http://www.lowrisc.org/blog/2016/03/appl
6353

6454
Initial implementation reuse part of FPGA hardware: http://www.lowrisc.org/docs/untether-v0.2/ , they are trying to open things up further.
6555

56+
Uses Verilator for simulation.
57+
58+
## Rocket
59+
60+
Tooling to generate Chips.
61+
62+
<https://github.com/ucb-bar/rocket-chip>
63+
64+
Uses Chisel, which is Scala based: <https://github.com/ucb-bar/chisel>
65+
66+
Used by lowRISC.
67+
68+
By Berkley people.
69+
70+
2015 presentation by Yunsup Lee <https://www.youtube.com/watch?v=Ir3h3qWcNlg>
71+
72+
A single source code + some input parameters can generate:
73+
74+
- C++ simulator code
75+
- FPGA Verilog
76+
- ASIC Verilog
77+
78+
TODO: any plans for silicon production?
79+
80+
http://www.lowrisc.org/docs/untether-v0.2/
81+
82+
2016 thesis on it: <http://www.eecs.berkeley.edu/~waterman/papers/phd-thesis.pdf>
83+
6684
## SiFive
6785

68-
http://sifive.com/
86+
<http://sifive.com/>
6987

7088
Startup around RISC-V tech by Berkley people, contributors to <https://github.com/riscv/riscv-tools>
7189

@@ -83,7 +101,7 @@ The project owner works at Rackspace, who is partnering with Google for open sou
83101

84102
## OpenRISC
85103

86-
https://en.wikipedia.org/wiki/OpenRISC
104+
<https://en.wikipedia.org/wiki/OpenRISC>
87105

88106
LGPL / GPL. TODO: history?
89107

@@ -97,6 +115,8 @@ ETH Zurich.
97115

98116
Previously closed source custom ISA I think, then opened and front-end hacked for RISC-V.
99117

118+
Uses ModelSim...
119+
100120
## News
101121

102122
2016 indiegogo https://www.indiegogo.com/projects/risc-v-microprocessor/x/6766065#/
@@ -108,3 +128,17 @@ Previously closed source custom ISA I think, then opened and front-end hacked fo
108128
<http://riscv.org/2016/04/risc-v-offers-simple-modular-isa/>
109129

110130
<https://www.quora.com/Would-RISC-V-become-the-dominant-CPU-architecture-in-the-next-5-years-given-that-Google-Oracle-and-HP-are-strongly-rallying-behind-RISC-V>
131+
132+
## Tethered vs untethered
133+
134+
<https://youtu.be/XSyH9T-Cj4w?t=64> tethered cannot do IO on itself: <https://www.youtube.com/watch?v=XSyH9T-Cj4w>
135+
136+
Rocket it tethered, lowRISC untethered.
137+
138+
## Hardware implementations
139+
140+
- <https://github.com/lowRISC/lowrisc-chip>
141+
- <https://github.com/ucb-bar/rocket-chip>
142+
- <https://github.com/ucb-bar/riscv-boom>
143+
- <https://github.com/cliffordwolf/picorv32>
144+
- Pulpino

0 commit comments

Comments
 (0)