8080 Emulator

This repo contains worked out tutorials to learn software emulation. The main goal is to write a C based functional 8080 emulator. Post which we will move to emulation Nintendo’s GameBoy in a separate Repo (or playstation maybe). For now, let’s get going with the tutorials on Emulator 101. Note: These might changes as I learn more and currently may not be the best way to go about things. But really what is?...

January 15, 2021 · 7 min · Pranay Garg

CSA, Torque & builtins

Introduction & Rational Imagine you were implementing the V8 engine. Your main target is to be able to run the ECMAScript specification for Javascript. This requires reading through the comprehensive specification and implement the required behavior. V8’s optimizing compiler Turbofan uses a combination of techniques to make long-running code faster with help of type information and optimizations. However, you would still require a good baseline performance for all the functions that ECMAScript defines....

November 14, 2020 · 8 min · Pranay Garg

Exploring V8 Engine - II (Control Flow & Memory Structures)

In this post, we will start our exploration of V8 engine and look under the hood at call sequences that are made to execute a simple 'hello' + 'world' command. This post is a follow up to our Exploring V8 Engine - I post. Setting up release.sample build (monolithic with debug) To test out the V8 embedding, you need a compile your sample hello-world.cc file with the V8 source code. Doing this for each sample would be tedious....

October 15, 2020 · 5 min · Pranay Garg

Exploring the V8 engine - I

Exploring the V8 engine - I This post starts our exploration into the V8 sourcecode. We use the hello-world.cc and the embedding process as our starting point and go exploring from there. Introduction V8’s codebase is no small beast. It keeps getting updated all the time with faster and often changes which refine a huge chunk of internal structures. Our motivation in this post is to understand the basics about the staple objects in V8’s execution context alongside the basic control flow....

September 23, 2020 · 6 min · Pranay Garg

Chromium C++ Primer for C++98 Folks

Chromium C++ Primer for C++98 Folks lvalues, rvalues, C++11/14 & Chromium({}, auto, constructor: var_name{}, yada, yada, yada … ) Introduction C++ powers most of the V8 engine. All the memory management logic, Ignition Interpreter, Turbofan (Optimizing compiler) are written in C++. Thus, it’s very much required for anyone beginning with V8 exploitation to brush up their C++ skills enough to understand V8’s source code. While a lot of us have run into C++ at some point in our lives, if it wasn’t in a recent production code (which isn’t older than you are) there’s a great chance you never ran into the new, expansive, and a little different world of new features from C++11/14....

September 2, 2020 · 8 min · Pranay Garg

Intro_to_Computer_Systems

Introduction CMU’s 15-213, Introduction to Computer Systems is an amazing course. It teaches you elements of Operating Systems and System Software in a way few undergraduate level courses do. The course covers everything from how systems interpret software, all the way to how addressing, signals and locks work on a higher level. What makes it brilliant is the applicability of the course. Whether you’re a budding Systems guy or a Web developer (mean no harm :P), it’s got something for everyone....

June 25, 2020 · 2 min · Pranay Garg

RCs and Unix applications

This post describe with rc files are and what they are used for pertaining to the Unix world. Have you seen the files ending with “rc”? (vimrc, screenrc) History As with everything in life, all that we use have a backstory. If you take a look at the Unix section of the wiki page on configuration files, leads to the wiki page on run commands, which is where the rc comes from....

May 15, 2020 · 2 min · Pranay Garg