[{"content":"Project Overview #When you are writing C, it is easy to take standard library functions like malloc and free for granted. To really understand what happens under the hood, I decided to build my own custom dynamic memory allocator from scratch to serve as a replacement for the libc defaults.\nMy main goal was to balance two competing forces: squeezing the most out of available memory (keeping fragmentation low) and maintaining high speed (minimizing the CPU cycles needed to service memory requests). To pull this off, the allocator bypasses the standard library entirely and manages the heap directly using the operating system\u0026rsquo;s sbrk() and mmap() system calls.\nArchitecture \u0026amp; Free List Management #To keep track of which memory blocks are in use and which are available, I built an Explicit Free List architecture.\nA simple approach (an implicit list) forces the system to scan every single block in the heap just to find a free spot. Instead, my implementation embeds pointers directly inside the unused memory blocks themselves, wiring them together into a doubly linked list. This optimization slashes the time complexity for allocations from O(N) down to O(F), where F is just the number of currently free blocks.\nBlock Header \u0026amp; Footer Design #Every block of memory needs metadata to track its size and whether it is currently allocated. To ensure the allocator can instantly merge adjacent free blocks (achieving O(1) coalescing), I used a boundary tag system with headers and footers.\nBecause memory alignment guarantees that block sizes are always even numbers, the lowest bit is essentially unused. I was able to hijack that lowest bit of the size variable to act as the allocation flag, a bitwise trick that saves memory overhead.\n/*Std struct for the allocator*/ typedef struct block_node { size_t size_and_allocated; //Size of the block + allocated flag in LSB struct block_node *next; //Pointer to next free block (only valid if free) struct block_node *prev; //Pointer to prev free block (only valid if free) } block_node_t; ","date":null,"permalink":"https://ioleynik.com/projects/custom-malloc/","section":"Projects","summary":"","title":"Custom Dynamic Memory Allocator"},{"content":"The Problem with Cloud Cameras #Most smart security cameras just blindly stream video to the cloud 24/7. That eats up a massive amount of bandwidth and introduces unnecessary lag. I wanted to build something faster and more efficient, so I engineered an edge-computing camera using a Raspberry Pi 5.\nInstead of sending raw video out to a server for processing, my system handles all the computer vision locally. By leveraging the YOLOv4-tiny model, the camera detects objects in real time on the device itself. It only actually pings the cloud when it confidently spots a specific target, like a person or a vehicle.\nSqueezing Performance out of the Hardware #Running neural networks on a single-board computer is a balancing act. You have to carefully manage resources to keep the frame rate (FPS) smooth without thermal throttling the CPU. Here is how I made it work:\nThe Hardware: The Raspberry Pi 5 provided a massive jump in processing power over older generations. It gave me the throughput needed to continuously process frames straight from the CSI camera module. The Model: I chose YOLOv4-tiny over the standard YOLO variants. Its smaller footprint and lower computational overhead make it a perfect fit for edge deployment. The Acceleration: To speed things up, I used OpenCV\u0026rsquo;s Deep Neural Network (DNN) module to load the weights. By optimizing the inference loop, the system can reliably extract bounding boxes and confidence scores in real time without stuttering. #Simple OpenCV DNN Inference Loop for YOLOv4-tiny import cv2 import numpy as np net = cv2.dnn.readNet(\u0026#34;yolov4-tiny.weights\u0026#34;, \u0026#34;yolov4-tiny.cfg\u0026#34;) layer_names = net.getLayerNames() output_layers = [layer_names[i-1] for i in net.getUnconnectedOutLayers()] def processFrame(frame): height, width, channels = frame.shape #Prepare the frame for the neural network blob = cv2.dnn.blobFromImage(frame, 0.00392, (416, 416),(0, 0, 0), True, crop=False) net.setInput(blob) outs = net.forward(output_layers) # Extract bounding boxes, confidences, and class IDs for out in outs: for detection in ","date":null,"permalink":"https://ioleynik.com/projects/edge-ai-camera/","section":"Projects","summary":"","title":"Edge AI Security Camera \u0026 Cloud Alerting"},{"content":"Project Overview #I prefer swing trading ordinary shares, but I simply don\u0026rsquo;t have the time to sit and stare at charts all day. To solve this, I built an automated trading system. By mixing Reinforcement Learning (RL) and evolutionary algorithms, the engine constantly trains and tests virtual trading agents on historical market data. The main goal is optimizing the Sharpe Ratio to maximize returns while managing risk so the system can make decisions on its own.\nEquity curve after 100 training cycles. Mostly follows S\u0026P 500 performance when limited training is applied, due to true randomness being roughly equal to simply holding. System Architecture #The project ties together an automated data pipeline, parallel reinforcement learning environments, and a live web dashboard to monitor everything in real time.\nBackend: Powered by FastAPI and Uvicorn, which acts as the central brain to handle background training requests and serve the UI. Data Pipeline: I hooked the system up to the yfinance API to pull historical prices and automatically compile technical indicators like SMA, RSI, and MACD using NumPy and Pandas. It caches everything locally so I don\u0026rsquo;t hit API limits during heavy generational training runs. The AI Stack: Built on Stable Baselines3 (using PPO and A2C algorithms) running on top of custom Gymnasium trading environments. Frontend Dashboard: A clean HTML/JS interface that polls the backend to show live training metrics and Sharpe ratios on an interactive chart. The Custom Gymnasium Environment #The actual trading logic lives inside a custom SimpleTradingEnv class that plugs right into Stable Baselines3. It basically simulates a market for a single stock where the AI learns how to manage a portfolio\u0026rsquo;s cash and equity.\nAction and Observation Space #What does the AI actually see? It looks at a continuous observation vector containing the current Close price, SMA, RSI, MACD, how much stock we currently hold, and our available cash. Based on that snapshot, it outputs a decision between -1.0 and 1.0, scaling anywhere from going 100% short to 100% long on the position.\nReward Function #To train the AI, it needs to know if it\u0026rsquo;s making good trades. The environment grades the agent step-by-step, calculating its reward based on the daily change in total equity (cash plus the actual value of the holdings). I also built in simulated slippage and trading fees to keep the training as realistic as possible.\n#Calculating the reward via equity delta equity_before = self._mark_to_market(price) target_position_value = float(np.clip(a, -self.max_w, self.max_w)) * equity_before current_position_value = float(self.position * price) delta_value = target_position_value - current_position_value # trade execution and fee deduction ... equity_after = self._mark_to_market(new_price) reward = float(equity_after - equity_before) ","date":null,"permalink":"https://ioleynik.com/projects/stock-optimizer/","section":"Projects","summary":"","title":"Evolutionary Machine Learning Stock Optimizer"},{"content":" Ilya Oleynik Computer Engineering Undergraduate | Embedded Systems \u0026 Aerospace Software\nView My Projects Download Resume About Me I am a Computer Engineering undergraduate at the University at Buffalo, minoring in Electrical Engineering. My core focus lies in the point where software intersects with hardware, specifically in flight software engineering and low level driver implementation. Currently, I am the Flight Software Lead at the UB Nanosatellite Laboratory (UBNL), leading the development of mission flight applications for the PIP-07 satellite using the NASA core Flight System (cFS). Additionaly, I work on many of my own projects, which you can look through descriptions of on this website. Technical Stack Languages C / C++ Python Java ARM Assembly Embedded \u0026 Hardware STM32 / ESP32 ARM Cortex RTEMS / FreeRTOS Oscilloscope \u0026 Logic Analyzer Tools \u0026 Protocols NASA cFS Docker \u0026 Git Linux / GDB I2C / SPI / UART / CAN ","date":null,"permalink":"https://ioleynik.com/","section":"Home","summary":"","title":"Home"},{"content":"Project Overview #I do a lot of DIY maintenance on my 2007 Honda Accord LX, and I was tired of the limitations of generic OBD-II scanners. To get better visibility into what the engine was actually doing, I built my own telemetry logger from scratch. Instead of relying on a commercial black box, this taps into the car\u0026rsquo;s Engine Control Unit (ECU) to pull live engine metrics, read diagnostic trouble codes (DTCs), and see raw CAN bus traffic.\nHardware Architecture #To build the physical module, I used an ESP32 microcontroller because it has a built in CAN controller (TWAI) and plenty of processing speed to handle the vehicle\u0026rsquo;s network traffic.\nBridging the Logic Gap: The ESP32 operates on 3.3V logic, while the car\u0026rsquo;s internal CAN network uses higher differential voltages. I wired in an SN65HVD230 CAN transceiver to safely translate signals between the two. Power \u0026amp; Interface: I used a standard J1962 OBD-II to DB9 cable to tap right into the car\u0026rsquo;s CAN High (Pin 6) and CAN Low (Pin 14) lines. To keep the setup entirely self contained, the board draws 12V power directly from the diagnostic port, which I stepped down through a buck converter to safely power the ESP32. Software \u0026amp; Protocol Implementation #I wrote the firmware in C++, focusing on fast polling and ensuring the microcontroller could speak the car\u0026rsquo;s language over the Controller Area Network.\nAsking for Data (PID Querying): I implemented the standard SAE J1979 diagnostic protocol. The ESP32 broadcasts a request across the network to the ECU (using ID 0x7DF) asking for specific Parameter IDs (PIDs)—like 0x0C for RPM, 0x0D for Vehicle Speed, or 0x05 for Engine Coolant Temperature. Translating the Response: I set up an interrupt receiver to catch the ECU\u0026rsquo;s reply (0x7E8). The software extracts the raw hexadecimal payload and runs it through standard OBD-II formulas to turn those bytes into readable values. /*Simplified example of req and pars Engine RPM over CAN*/ void request_rpm() { can_message_t tx_msg; tx_msg.identifier = 0x7DF; tx_msg.extd = 0; tx_msg.data_length_code = 8; tx_msg.data[0] = 0x02; //Number of additional bytes tx_msg.data[1] = 0x01; //Service 01 (Show current data) tx_msg.data[2] = 0x0C; //PID 0C (Engine RPM) //Pad remaining bytes to complete the frame for(int i = 3;i \u0026lt; 8; i++) tx_msg.data[i] = 0xAA; twai_transmit(\u0026amp;tx_msg, pdMS_TO_TICKS(1000)); } void parse_rpm_response(can_message_t *rx_msg) { //Check if response is from ECU and matches the RPM PID if (rx_msg-\u0026gt;identifier == 0x7E8 \u0026amp;\u0026amp; rx_msg-\u0026gt;data[2] == 0x0C) { uint8_t a = rx_msg-\u0026gt;data[3]; uint8_t b = rx_msg-\u0026gt;data[4]; //Standard OBD-II formula for RPM float rpm = ((a * 256.0) + b) / 4.0; printf(\u0026#34;Current RPM: %.2f\\n\u0026#34;, rpm); } } ","date":null,"permalink":"https://ioleynik.com/projects/obd2/","section":"Projects","summary":"","title":"OBD-II Diagnostic Logger \u0026 Telemetry"},{"content":"Project Overview #Pintos is an instructional operating system framework for x86 architectures. For this project, I built out kernel subsystems completely from scratch in C. The goal was to take a bare-bones shell and turn it into a fully functional operating system that could actually manage memory, handle complex thread synchronization, execute programs, and run a file system.\nThread Scheduling \u0026amp; Synchronization #A reliable OS needs a smart way to manage threads, so I overhauled the basic scheduler to make it efficient and ensure it respected strict priority rules.\nEfficient Alarm Clock: The default setup had sleeping threads constantly checking the time (busy waiting), which burned through CPU cycles. I replaced this with an interrupt driven sleep queue. Threads now actually block and go to sleep until their timer expires, freeing up the CPU for other tasks. Priority Inheritance: One of the annoying problems in OS design is priority inversion. When a low priority thread holds a lock that a high priority thread desperately needs. To fix this, I built a strict priority donation protocol. A lock holder now temporarily inherits the priority of the highest priority thread waiting on that lock. It handles nested donations and revokes the priority the second the lock is released so the system doesn\u0026rsquo;t stall out. Virtual Memory \u0026amp; Custom Allocation #When you are writing a bare-metal kernel, you don\u0026rsquo;t get the luxury of standard C libraries—there is no built in malloc or free. I had to engineer my own memory management subsystems to handle both kernel level memory and user space virtual memory.\nCustom Kernel Allocator (malloc): I built a block allocator from scratch. It segments raw memory pages into distinct blocks, maintains free lists, and uses an efficient allocation algorithm to serve requests of any byte size while keeping memory fragmentation to an absolute minimum. Demand Paging \u0026amp; Swapping: I implemented a supplemental page table to handle page faults lazily. Instead of loading everything into memory at startup, pages are only pulled from the executable or swap space when a program explicitly tries to access them. Page Replacement: Because physical memory runs out quickly, I designed an eviction algorithm (using an LRU/clock approximation) to intelligently write older pages back to a swap partition when the system hits its limits. /*kernel memory allocation */ void *malloc (size_t size) { if (size == 0) return NULL; //Determine the optimal block size arena for the request struct arena *a = find_best_arena(size); //Acquire a block from the free list, handling page alloc if the arena is exhausted void *block = arena_alloc(a); return block; } ","date":null,"permalink":"https://ioleynik.com/projects/pintos-kernel/","section":"Projects","summary":"","title":"Pintos Operating System Kernel \u0026 Memory Allocation"},{"content":"Featured Engineering Work #Here is a collection of my flight software, avionics, and embedded systems projects.\nMachine Learning \u0026 Python 2025 – 2026 Evolutionary Machine Learning Stock Optimizer To find the best stock combinations, I developed a Python-based genetic algorithm that evolves portfolio models over time to maximize the Sharpe Ratio. The system trains on historical ETF data pulled directly from the Yahoo Finance API, and I tied it all together with a custom HTML/CSS dashboard for real-time tracking. Python Genetic Algorithm View Project Details \u0026rarr; Operating Systems \u0026 C 2025 – 2026 Pintos Operating System Kernel \u0026 Memory Allocation For the Pintos educational kernel, I developed core operating system components from the ground up in C. A major focus of this project was thread synchronization, where I implemented priority inheritance to resolve priority inversion on locks and semaphores. C Kernel Development View Project Details \u0026rarr; Embedded Hardware \u0026 IoT 2026 OBD-II Diagnostic Logger \u0026 Telemetry To get better diagnostic data during vehicle maintenance, I engineered a custom OBD-II telemetry logger for a 2007 Honda Accord using an ESP32 microcontroller. The system extracts real-time CAN bus data, allowing me to monitor live engine metrics and pull diagnostic trouble codes directly from the car's computer. ESP32 C++ CAN Bus View Project Details \u0026rarr; Edge AI \u0026 IoT 2026 Edge AI Security Camera \u0026 Cloud Alerting I engineered a smart security system that deploys the YOLOv4-tiny object detection model natively on a Raspberry Pi 5. By optimizing the system for edge computing, it identifies threats locally in real time. This approach drastically cuts down on latency and bandwidth usage while still reliably triggering automated cloud-based alerts when an object is detected. Raspberry Pi 5 YOLOv4-tiny Computer Vision View Project Details \u0026rarr; Systems Programming \u0026 C 2025 Custom Dynamic Memory Allocator I developed a custom, thread-safe dynamic memory allocator in C to serve as a drop-in replacement for the standard glibc malloc. By implementing explicit free lists, block splitting, and bidirectional coalescing, I was able to highly optimize heap usage, keep memory fragmentation to a minimum, and maintain high throughput for concurrent processes. C Memory Management Data Structures View Project Details \u0026rarr; ","date":null,"permalink":"https://ioleynik.com/projects/","section":"Projects","summary":"","title":"Projects"},{"content":"Education # 2023 – Present University at Buffalo Pursuing a Bachelor of Science in Computer Engineering with a minor in Electrical Engineering. Focusing heavily on embedded systems, low-level programming, and hardware-software integration. Computer Engineering Electrical Engineering Minor Experience # Aerospace \u0026 Flight Software Aug 2025 – Present Flight Software Lead — PIP-07 Satellite Directing flight software development for the PIP-07 satellite at the UB Nanosatellite Laboratory (UBNL), contracted by the Air Force Research Laboratory. Authoring core Flight System (cFS) applications in C, leading architectural trade studies, and standardizing development workflows. C NASA cFS Docker Embedded Hardware \u0026 Software 2025 - Present Undergraduate Avionics Engineer — SEDS Developed custom STM32 drivers for rocket payloads and rocketry PCBs. Analyzed schematics and chip datasheets for hardware-software compatibility, implementing communication protocols like I2C, CAN, and UART for sensor data acquisition. STM32 C / C++ I2C / CAN / UART ","date":null,"permalink":"https://ioleynik.com/experience/","section":"","summary":"","title":""},{"content":"Let\u0026rsquo;s Connect #I am currently seeking a summer Software Engineering Internship and am always open to discussing new opportunities in flight software, embedded systems, and aerospace engineering.\nEmail oliynyk.ilya413@gmail.com\nPhone (631)-530-4415\nLinkedIn Let's network\n","date":null,"permalink":"https://ioleynik.com/contact/","section":"Contact","summary":"","title":"Contact"},{"content":"","date":null,"permalink":"https://ioleynik.com/tags/","section":"Tags","summary":"","title":"Tags"}]