Low Byte ProductionsThis this episode we implement memory mapped I/O, where the address space is utilised as common bus for components to communicate.
=[ ℹ About ℹ ]=
This series is all about building a powerful virtual machine in JavaScript with the following features:
- A flexible, extensible, register-based virtual machine - Support for signed, unsigned and floating point operations - A call stack - Interrupt capabilities - Ability to do memory mapping for IO - An assembly language with macro and module support - A higher level, C like language. We'll use and expand the library from the parser combinators from scratch series - And finally, to be able to take the whole thing into the browser and exend it to create a sort of fantasy console - an emulator for a machine that never existed
What is Memory Mapped I/O? (16-Bit VM in JavaScript 005)Low Byte Productions2019-12-25 | This this episode we implement memory mapped I/O, where the address space is utilised as common bus for components to communicate.
=[ ℹ About ℹ ]=
This series is all about building a powerful virtual machine in JavaScript with the following features:
- A flexible, extensible, register-based virtual machine - Support for signed, unsigned and floating point operations - A call stack - Interrupt capabilities - Ability to do memory mapping for IO - An assembly language with macro and module support - A higher level, C like language. We'll use and expand the library from the parser combinators from scratch series - And finally, to be able to take the whole thing into the browser and exend it to create a sort of fantasy console - an emulator for a machine that never existed
- Github Repo: github.com/LowLevelJavaScript/16-Bit-Virtual-Machine - Memory Mapped IO: en.wikipedia.org/wiki/Memory-mapped_I/O - Address Space: en.wikipedia.org/wiki/Address_spaceFixed-point math is better than floating point (sometimes)Low Byte Productions2024-06-22 | In this video, we're learning about fixed-point: A different method for doing non-integer arithmetic without floats! Floating point is a ubiquitous standard that works everywhere, but it needs specialised hardware to have any chance of running fast. This can make calculations on low-powered microcontrollers extremely expensive. Fixed-point solves, giving us a method for cheaply computing fractional results with flexible precision!
00:00:00 Intro 00:03:46 Floating point vs fixed point 00:10:07 Fixed point bit representation 00:17:10 Code: Fixed point defines 00:21:30 Getting to the integer and fractional parts 00:24:24 Sign function and representing ints in fixed point 00:32:14 Converting to and from floating point 00:36:23 Addition and subtraction 00:38:27 Multiplication 00:42:20 Division 00:48:52 Rounding operations 00:50:14 Absolute value 00:54:50 Floor 00:58:57 Getting the fractional part 01:02:38 Ceiling 01:05:37 Round 01:14:14 Motivating example: Analog to digital converter readings 01:30:10 Next time: Sines and cosines
=[ 🔗 Links 🔗 ]=
⭐️ Become a patron and get bonus videos! patreon.com/lowleveljavascript 🗣 Discord: discord.gg/FPWaVgk 💻 Github Repo: github.com/lowbyteproductions/fixed-point-mathRendering 3D Graphics On An OscilloscopeLow Byte Productions2024-03-08 | In this video, we're learning how to draw on an oscilloscope. By utilising the X-Y mode of the scope, combined with some clever firmware to generate the right signals, and a sprinkle of DIY digital-to-analog conversion, we can render animated 3D graphics on a scope in real time!
00:00:00 3D Animated Demo 00:01:36 Understanding X-Y Mode 00:05:00 Firmware Architecture Overview 00:09:52 PWM Digital-to-Analog Conversion 00:14:48 Manually creating images 00:21:57 Visualizing the signals 00:25:03 Writing the static image firmware 00:48:30 PWM signals on the scope 00:51:14 Building the low-pass filters 00:58:42 First 3D image 01:03:30 Reading the 3D renderer firmware code 01:17:15 Final demo
=[ 🔗 Links 🔗 ]=
⭐️ Become a patron and get bonus videos! patreon.com/lowleveljavascript 🗣 Discord: discord.gg/FPWaVgk 💻 Github Repo: github.com/lowbyteproductions/3d-oscilloscope-rendererUsing LEDs As Precise GPIOsLow Byte Productions2024-02-17 | In this video, we're looking at a technique for precisely analyzing signals from firmware when all you can do is blink a LED. By writing to an LED as if it were a typical GPIO, and building a surprisingly simple receiver, we can probe signals with an oscilloscope without even touching the board!
Chapters 00:00 What is a WS2812 / NeoPixel 02:33 Hardware overview 06:00 What is a "device driver"? 08:35 The signalling protocol 15:00 Reviewing the datasheet 22:00 Figuring out the GPIO timing 49:32 First LED test 53:36 Implementing the driver interface
=[ 🔗 Links 🔗 ]=
🎥 Bare metal playlist: youtube.com/playlist?list=PLP29wDx6QmW7HaCrRydOnxcy8QmW0SNdQ 🗣 Discord: discord.gg/FPWaVgk ⭐️ Patreon: patreon.com/lowleveljavascript 💻 Github Repo: github.com/lowbyteproductions/stm32-ws2812bSpinning Persistence of VisionLow Byte Productions2023-12-24 | The letters are distorted because the outside of a circle spins faster than the inside. There is currently no syncing to the frequency of rotation, which is why the text processes.Getting up in another processes memoryLow Byte Productions2023-11-04 | In this video, we learn how we can read memory belonging to other processes by building a memory dumper from scratch. One of the key components is the /proc file system: an interface that the kernel provides for introspecting processes. Combined with ptrace, a system call that allows attaching to and taking control of another process, we write a program to automate extracting information that would otherwise be completely hidden to us!
🎥 Series Playlist: 🗣 Discord: discord.gg/FPWaVgk ⭐️ Patreon: patreon.com/lowleveljavascript 💻 Github Repo: github.com/mit-pdos/xv6-riscvTurning Pixels Into WavesLow Byte Productions2023-10-21 | In this video, we're building an awesome graphical effect, where an image is processed into a series of animated waves. The math behind the technique is fascinating, and will lead us into to how sine waves work, the magic of linear interpolation, and signal processing techniques like amplitude modulation!
=[ 🔗 Links 🔗 ]=
🗣 Discord: discord.gg/FPWaVgk ⭐️ Patreon: patreon.com/lowleveljavascript 💻 Github Repo: github.com/lowbyteproductions/Turning-Pixels-Into-WavesHow does KERNEL memory allocation work? //Source Dive// 004Low Byte Productions2023-10-13 | In this installment of //Source Dive//, we're deep in the xv6 operating system, trying to understand how physical memory of the system is tracked, distributed, and returned to the kernel. It's a fascinatingly simple algorithm, which can be paradoxically kind of hard to understand!
🎥 Series Playlist: 🗣 Discord: discord.gg/FPWaVgk ⭐️ Patreon: patreon.com/lowleveljavascript 💻 Github Repo: github.com/mit-pdos/xv6-riscvVirtual Console and printf() //Source Dive// 003Low Byte Productions2023-09-30 | In this installment of //Source Dive//, we're back in xv6, looking at how the operating system layers abstractions. The "console" is a great example, with a low-level driver rooted in the hardware, to an abstract console, to the printf function that eventually outputs characters to the screen.
🎥 Series Playlist: 🗣 Discord: discord.gg/FPWaVgk ⭐️ Patreon: patreon.com/lowleveljavascript 💻 Github Repo: github.com/mit-pdos/xv6-riscvProgrammatic Painting: Flow FieldsLow Byte Productions2023-09-23 | In this video, we're drawing generative art in the form of flow fields! Flow fields are mathematical structures where every point of a space is associated with an angle, and by carefully choosing those angles, we can trace out the path of particles moving across the field, creating some beautiful images.
🎥 Series Playlist: 🗣 Discord: discord.gg/FPWaVgk ⭐️ Patreon: patreon.com/lowleveljavascript 💻 Github Repo: github.com/mit-pdos/xv6-riscvCryptographically Signed Firmware :: Bare Metal Programming Series 14Low Byte Productions2023-08-06 | In the final episode of the Bare Metal Programming Series, we're implementing signed firmware updates! Everything from using AES in the CBC-MAC configuration in the bootloader, to writing a signing application, to updating the firmware updater to work with the new images. And of course, where would we be without a false celebration before the ultimate solution 😉
🎥 Series Playlist: youtube.com/playlist?list=PLP29wDx6QmW7HaCrRydOnxcy8QmW0SNdQ 🗣 Discord: discord.gg/FPWaVgk ⭐️ Patreon: patreon.com/lowleveljavascript 💻 Github Repo: github.com/lowbyteproductions/bare-metal-seriesBootloader Firmware Update Mechanism :: Bare Metal Programming Series 10Low Byte Productions2023-06-24 | In this episode, we're finally building the core firmware update mechanism in the bootloader! This involves taking all the elements we've been working on until now - timers, state machines, the packet protocol on top of uart, etc - and putting them together into a bootloader firmware that is able to communicate with a host PC and receive a firmware update. In the next video, we'll build the PC side application, and complete this major milestone, before moving on to implementing a cryptographic code signing mechanism, to ensure only authorised code can be loaded onto the device.
🎥 Series Playlist: youtube.com/playlist?list=PLP29wDx6QmW7HaCrRydOnxcy8QmW0SNdQ 🗣 Discord: discord.gg/FPWaVgk ⭐️ Patreon: patreon.com/lowleveljavascript 💻 Github Repo: github.com/lowbyteproductions/bare-metal-seriesProgrammatic Flash Control :: Bare Metal Programming Series 8Low Byte Productions2023-06-06 | In this installment of the bare metal programming series, we're diving into how the flash peripheral of the STM32F401 chip works, and building out a little layer to be able to write a new main application from the bootloader. This serves as an excellent opportunity to cross reference the details of the reference manual with the APIs provided by libopencm3 - going from a register level understanding, to a higher level implementation!
🎥 Series Playlist: youtube.com/playlist?list=PLP29wDx6QmW7HaCrRydOnxcy8QmW0SNdQ 🗣 Discord: discord.gg/FPWaVgk ⭐️ Patreon: patreon.com/lowleveljavascript 💻 Github Repo: github.com/lowbyteproductions/bare-metal-seriesDesigning A Packet Protocol :: Bare Metal Programming Series 7.1Low Byte Productions2023-05-15 | In this episode of the bare metal programming series, we're going over the design of a packet protocol, that runs on top of the UART physical layer we've been building up over the last few videos. This protocol consists of a binary packet format, which includes a mechanism for validating the integrity of a packet, as well as a state machine for processing incoming packets, validating them, and automatically requesting retransmission if the packet fails the check.
Being able to read assembly (if not write it) is a valuable skill - and can help tremendously in both debugging and making sensible performance optimisations.
We'll cover: - Installing and compiling libopencm3 - Setting up the core system clock - Configuring a GPIO - Writing a roughly accurate time delay function - Blinking a LED
This video introduces: - the series - what we'll be covering - who the intended audience is - the goals and the non-goals - the hardware you'll need to follow along
00:00:00 – Intro 00:02:12 – GameBoy Coding Adventure Book 00:03:18 – The plan 00:09:52 – Writing the ROM dumper code 01:14:28 – The GameBoy link port and cable 01:17:52 – Wiring up to the logic analyzer 01:21:18 – Logic SPI setup 01:25:45 – Dumping the ROM 01:31:40 – Processing the dump into a raw binary file 01:40:12 – Testing in an emulator
00:00:00 – Intro 00:05:23 – Demo on real hardware 00:06:48 – TEGA Overview 00:08:22 – Modules! No linker required 00:11:18 – Loads, Stores, and instruction representability 00:21:05 – Arithmetic and Logic 00:25:17 – Jumps, Labels, and Branches 00:29:45 – Macro abstraction examples 00:39:28 – Building a ROM 00:45:16 – The GameBoy Memory Map 00:56:58 – Block Jump Code Overview 01:05:39 – Tile graphics 01:12:26 – The DMA routine, and virtual symbol offsets 01:19:19 – Setting up the LCD screen 01:23:52 – Organising values in RAM 01:29:22 – Setting up OAM 01:33:34 – Setting up the player character and obstacle structs 01:35:26 – The main game loop 01:38:08 – Random Number Generation 01:42:26 – Game State Machine 01:53:23 – Jump Physics 02:05:43 – Compression: Encoding side 02:12:42 – Compression: Decoding side 02:17:59 – Running and Debugging in an emulator 02:30:50 – OutroROM Hacking: Exploring The BPS Binary Patch FormatLow Byte Productions2022-11-01 | In this video, we're exploring the BPS binary patch format, used extensively in the ROM hacking scene. BPS has a number of improvements over the IPS format we looked at in a previous installment, offering better composition, compression, and error checking.
IPS is a relatively old and simple format, and not in widespread use these days, but taking a look at the details provides a lot of insight into the subject, as well as a clear direction for the formats that succeeded it.
Find a team, ask for help, or just come to chat over at the discord server discord.gg/59tmtaQe3X.
Hope to see you there, and can't wait to see what you come up with!The Emulator Is Done?!: RISC-V ep.12Low Byte Productions2022-05-18 | In this final installment of the RISC-V (emulator) series, we implement a multi-cycle memory interface. With this in place, the design is complete enough to move forward and begin design honest-to-goodness FPGA hardware!
The design involves building a new module, as well as a new super-state of the CPU, which controls when the processor is executing the pipeline, and when it is handling the mechanics of traps.