Skip to content

Instantly share code, notes, and snippets.

View smalinux's full-sized avatar
🎯
FOCUS

Sohaib Mohamed smalinux

🎯
FOCUS
View GitHub Profile
@smalinux
smalinux / x11.c
Last active December 15, 2020 07:49
My X11 simple window creation example.
// gcc x11.c -L/usr/X11R6/lib -lX11 -o x11
#include <X11/Xlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
Display *d;
Window w;
XEvent e;
@smalinux
smalinux / timer.c
Created November 25, 2020 17:37 — forked from yagihiro/sample.c
timer sample on linux kernel
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/timer.h>
#include <linux/jiffies.h>
static void mykmod_timer_handler(unsigned long data);
static unsigned long onesec;
DEFINE_TIMER(mytimer, mykmod_timer_handler, 0, 0);
/*
* linux/fs/exec.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
*/
/*
* #!-checking implemented by tytso.
*/
/*
@smalinux
smalinux / Makefile
Created April 22, 2020 04:21
Hello, world USB driver
# Set module name from the list:
program = sma_usb
# 'The list'
#----------
obj-m += sma_usb.o
# obj-m += sma_chardev.o
# obj-m += sma_skeleton.o
all:
# ./fasm/fasm boot.asm
nasm -f bin boot.asm -o boot.bin
run:
# bochs
qemu-system-x86_64 boot.bin
@smalinux
smalinux / config.h
Created December 27, 2019 09:42
PIC problem 101
/* Microchip Technology Inc. and its subsidiaries. You may use this software
* and any derivatives exclusively with Microchip products.
*
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
* EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
* WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
* PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
* WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
*
* IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
@smalinux
smalinux / OSDev.org
Last active November 7, 2019 16:53
OS Dev Log!

OSDev.org

Category:Categories

====================================================================================

= OS_Development ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄

>= FAQ ▄ Not! >= Troubleshooting ▄ Not!

= Bare_bones_tutorials how to start Category. page for every programming lang!
@smalinux
smalinux / .vimrc
Created July 12, 2019 14:42
VimSetUp
" Note: Skip initialization for vim-tiny or vim-small.
if 0 | endif
if &compatible
set nocompatible " Be iMproved
endif
" Required:
set runtimepath+=~/.vim/bundle/neobundle.vim/
int age = 20;
int major = 0;
major = age >= 18; // this line <<<<<<<<<<<<<<<<<<<<<<<
printf(”Major equals : %d\n”, major);