Skip to content

Instantly share code, notes, and snippets.

View oriapp's full-sized avatar
🤓
passionate nerd who loves PHP

R C N oriapp

🤓
passionate nerd who loves PHP
  • A really really big corporation
  • Planet Earth
View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <dirent.h>
#include <string.h>
#include <ctype.h>
#include <sys/sysinfo.h>
#include <sys/types.h>
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define NUM_TASKS 4 // number of tasks
// structure to represent a task
typedef struct task {
int id; // task id
int burstTime; // time required to complete the task
@oriapp
oriapp / ata_lba_write.S
Created January 9, 2023 15:55
FAT16 ata lba write
; ata_lba_write - Write a sector to an ATA device using LBA mode
;
; @device: ATA device (0 for primary, 1 for secondary)
; @lba: LBA address of the sector to write
; @buffer: pointer to the buffer containing the data to write
;
; Returns: CF set on error, CF clear on success
global ata_lba_write
@oriapp
oriapp / rr.c
Created January 8, 2023 11:31
(Scheduling Algorithm) Round Robin PoC for my Operating System (v.2)
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define TIME_SLICE 5 // time slice for each task
// structure to represent a task
typedef struct task {
int id; // task id
int burstTime; // time required to complete the task
@oriapp
oriapp / rr.c
Created January 8, 2023 11:12
Round Robin PoC
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define QUANTUM 4 // time slice in milliseconds
// structure to represent a task
typedef struct task {
int id; // task id
int burstTime; // time required to complete the task
@oriapp
oriapp / CGame.c
Last active November 27, 2022 07:57
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <stdbool.h>
#define MIN_CELLS 10
#define MAX_CELLS 25
#define COINS 6
@oriapp
oriapp / bootloader.asm
Created November 14, 2022 20:44
bootloader
ORG 0x7c00
[BITS 16]
CODE_SEG equ gdt_code - gdt_start
DATA_SEG equ gdt_data - gdt_start
jmp short start
nop
@oriapp
oriapp / key.gpg
Created August 13, 2022 19:28
My PGP key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: This is a revocation certificate
iQG2BCABCgAgFiEEY6ET8KoTlAiufrv67OUQBwXw+zcFAmL3+xMCHQIACgkQ7OUQ
BwXw+zeQgwv+Jn4qGE1qp241R8cO7/nEfsNruizBtralAnBrlvYVd8fpoee3K685
49IONJB/pwYJiuRlEdvKv29W8arRPYwjAZQA36Mc/Ex0InPAB9oJUTBYTZ+JILon
6bRPF5s1KD3FsLigjzNYdRPlg0enSnr06WsVP+PtAphwxbnyOuE1TLdabN+HeHFS
n3A/HRzt+KyiEqQBfTA3wdHDy8mXcHIWMBUClHYuHz3cfAO2oN1Dj/AWF/BFaH6k
p/dBCaFcUJxEYLjfwUqXGn3gKEKZCU/bGukYOH+/qAGSPKYXr3IDO6AmUf6zDUg/
vsgjy1Rp8ieSarWs/wpWw8RptIct1/GaypHDbQq1hsObpgZ91zJrDvgFK7XFn72B
@oriapp
oriapp / genericType.c
Last active August 19, 2022 14:21
Generic type stack impl
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef enum
{
STACK_INT,
STACK_CHAR,
STACK_UINT64
} DataType;
#include <stdio.h>
int main() {
double long k = 1,
s = 0;
for (size_t i = 0; i < 1000000; i++)
{
if (i % 2 == 0)