Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
166 commits
Select commit Hold shift + click to select a range
5a56e75
add @asqel e1000 driver to kernel
elydre Nov 20, 2024
6cbb8a8
update
asqel Dec 4, 2024
25c8040
Merge branch 'main' into e1000
elydre Dec 4, 2024
ee88e03
update
asqel Dec 10, 2024
5347684
update
asqel Dec 11, 2024
93b0dd3
update
asqel Dec 18, 2024
f4a58f2
udpate
asqel Dec 18, 2024
3d54027
Merge branch 'main' into e1000
asqel Mar 19, 2025
72438e7
update
asqel Mar 19, 2025
f8e637b
Update ethernet_8168.c
asqel Mar 19, 2025
c3c66cf
uwu
asqel Mar 22, 2025
bf83aff
le e1000 marche en fait
asqel Mar 30, 2025
7db5c5d
e1000 work + bus mastering
asqel Mar 30, 2025
3d4b6ff
ca marchouille
asqel Mar 30, 2025
d78eb4d
OH
asqel Mar 31, 2025
c09823b
update
asqel Mar 31, 2025
7948b73
update
asqel Mar 31, 2025
7a05190
removed garbage + eth
asqel Apr 1, 2025
c5691aa
update clean
asqel Apr 2, 2025
df54557
update
asqel Apr 3, 2025
46315b8
update
asqel May 22, 2025
09f1a8a
Merge branch 'main' into e1000
asqel May 30, 2025
9d78e8d
added syscall listeners for eth
asqel May 31, 2025
ac8c5e5
clean+listener interface
asqel Jun 10, 2025
3c91702
clean
asqel Jun 11, 2025
0954bad
update
asqel Jun 12, 2025
f3ad101
ip-get
asqel Jun 13, 2025
d3afab5
maybe rtl8168 work
asqel Jun 13, 2025
ad1ee0c
update
asqel Jun 13, 2025
ec001ef
ping
asqel Jun 15, 2025
c61fed2
update
asqel Jun 19, 2025
95febe0
update
asqel Jun 19, 2025
e73905f
pni_recv return struct
asqel Jun 19, 2025
0f5e600
Create tftp.c
elydre Jun 19, 2025
0740253
Merge branch 'e1000' into tmp_tftp
elydre Jun 19, 2025
4e9e0c4
implement `inet_aton`
elydre Jun 19, 2025
ba2f612
Delete test.c
elydre Jun 19, 2025
ab85520
Update init.olv
elydre Jun 19, 2025
07d5499
Update tftp.c
elydre Jun 19, 2025
005746e
Update tftp.c
elydre Jun 20, 2025
a568b6f
start stp
asqel Jun 20, 2025
0478572
Merge remote-tracking branch 'origin/tmp_tftp' into e1000
asqel Jun 20, 2025
d396c6f
update
asqel Jul 15, 2025
27314b3
Merge branch 'main' into e1000_merge
elydre Sep 9, 2025
1e5adda
Update syscall.h
elydre Sep 9, 2025
10b618d
update
elydre Sep 9, 2025
e3a3d80
update
elydre Sep 9, 2025
e5788cc
fix driver
asqel Sep 10, 2025
0f12c7b
doc?
asqel Sep 10, 2025
29275ae
u
asqel Sep 11, 2025
5eb2e9b
u
asqel Sep 12, 2025
5e54c6e
u
asqel Sep 12, 2025
c61a6ec
update
asqel Sep 12, 2025
2eefd39
wip
asqel Sep 15, 2025
e83dac8
m
asqel Sep 19, 2025
b4c9a92
des truc
asqel Sep 21, 2025
c3398f9
Merge branch 'e1000' of https://github.com/elydre/profanOS into e1000
asqel Sep 21, 2025
968c140
update
asqel Sep 22, 2025
072f66a
u
asqel Sep 22, 2025
f902c3b
u
asqel Sep 24, 2025
f37bdc4
fix open
asqel Sep 25, 2025
c1d1775
fixed open
asqel Sep 25, 2025
163b661
u
asqel Sep 25, 2025
6a81335
u
asqel Sep 29, 2025
f192a2f
Merge branch 'main' into e1000
elydre Feb 18, 2026
e1bc87b
euu c'est reparer je crois
elydre Feb 18, 2026
a33978a
add sock type
elydre Feb 18, 2026
c5737a7
ohohoh?
asqel Feb 19, 2026
2bfabf4
laflemme
asqel Feb 20, 2026
69f01c4
i
asqel Feb 20, 2026
a180611
a
asqel Feb 23, 2026
8ea6485
remove garbage
asqel Feb 23, 2026
436997a
a
asqel Feb 23, 2026
7c03e54
a
asqel Feb 24, 2026
b099caa
a
asqel Feb 24, 2026
44a9fa9
PFIOU
asqel Feb 24, 2026
fef347a
omg on peux close
asqel Feb 28, 2026
3086e64
a
asqel Mar 1, 2026
9b0fe38
a
asqel Mar 1, 2026
eab2e1d
a
asqel Mar 2, 2026
6c4143e
a
asqel Mar 2, 2026
9d80bf6
netdb
asqel Mar 3, 2026
7de3f04
ou
asqel Mar 4, 2026
fc07f50
Merge branch 'main' into e1000
elydre Mar 5, 2026
eab353a
inet_pton
elydre Mar 11, 2026
520f089
Create client.c
elydre Mar 11, 2026
bc13c4c
Delete client.c
elydre Mar 12, 2026
101b2ac
call `inet_pton` in `gethostbyname`
elydre Mar 12, 2026
487c85b
patch poll
elydre Mar 12, 2026
44339f5
Merge branch 'main' into e1000
elydre Mar 15, 2026
fb7ce16
Merge branch 'main' into e1000
elydre Mar 15, 2026
2711333
Merge branch 'main' into e1000
elydre Mar 16, 2026
d379ce7
improver
elydre Mar 17, 2026
54f77e3
improver
elydre Mar 17, 2026
6f99b55
remove useless stuff
elydre Mar 17, 2026
1919e07
Update isr.c
elydre Mar 17, 2026
90b3674
Update ping.c
elydre Mar 17, 2026
0a77792
Delete viewer.css
elydre Mar 17, 2026
ec4f88f
aled
elydre Mar 17, 2026
a1ee710
Update e1000.c
elydre Mar 17, 2026
17336fe
oui
elydre Mar 17, 2026
ef1ea8b
jai fix le truc du port source la en fait pour que ca marche sinon c'…
asqel Mar 17, 2026
788d8f7
stp
elydre Mar 18, 2026
6061c5b
Update stp.c
elydre Mar 18, 2026
65b7003
a
asqel Mar 18, 2026
81c95b5
Merge remote-tracking branch 'refs/remotes/origin/e1000' into e1000
asqel Mar 18, 2026
901e4dc
Update fd.c
elydre Mar 19, 2026
4ff8b29
stp: error message + info and help commands
elydre Mar 19, 2026
5968376
Update stp.c
elydre Mar 19, 2026
035b7b0
a
asqel Mar 20, 2026
8d29203
a
asqel Mar 20, 2026
89a9550
init
asqel Mar 20, 2026
924b593
update stp
elydre Mar 20, 2026
1b2ea65
Update stp.c
elydre Mar 20, 2026
cada84c
Update stp.c
elydre Mar 20, 2026
c9932a3
Update stp.c
elydre Mar 20, 2026
6ea4c0c
preopre ? je crois
asqel Mar 20, 2026
b87e3f5
mhhh
asqel Mar 20, 2026
98c72f3
improver, because asqel never does
elydre Mar 21, 2026
358d8cc
Delete pci_old.h
elydre Mar 21, 2026
128a10b
Merge branch 'main' into e1000
elydre Mar 21, 2026
9c4a7ae
Update stp.c
elydre Mar 21, 2026
4374342
modulize e1000 driver
elydre Mar 24, 2026
db22eef
`__atdeath`
elydre Mar 24, 2026
cb825b5
modulize part 1
elydre Mar 24, 2026
95fc7da
modulize
elydre Mar 24, 2026
768d95c
modulize part 2
elydre Mar 25, 2026
160ce41
improver
elydre Mar 25, 2026
6dea8fe
aled
elydre Mar 25, 2026
b1dddcd
normalement j'ai rien cassé
elydre Mar 31, 2026
eee26b0
Delete rtl8168.h
elydre Mar 31, 2026
6ca3a5b
Update fmopen.c
elydre Mar 31, 2026
c417f68
Update fmopen.c
elydre Apr 1, 2026
6e9e1ba
improver
elydre Apr 1, 2026
7413254
a
asqel Apr 1, 2026
5d031b8
a
asqel Apr 1, 2026
1eddeb8
rmswp
asqel Apr 1, 2026
e18d1c7
ign
asqel Apr 1, 2026
c3c26f0
new stp client
elydre Apr 1, 2026
6acf2a9
Merge branch 'e1000' of https://github.com/elydre/profanOS into e1000
elydre Apr 1, 2026
758ffcb
patch socket
elydre Apr 1, 2026
1abdc23
Delete dump.dat
elydre Apr 1, 2026
184737c
update linker scripts
elydre Apr 1, 2026
b80355a
improver
elydre Apr 3, 2026
3e52255
ip-get in a single file (sorry)
elydre Apr 3, 2026
22d2499
Update init.olv
elydre Apr 3, 2026
9d1ea60
patch for old ld versions
elydre Apr 3, 2026
4f93840
update
elydre Apr 3, 2026
617d335
ip-get started by rosemary
elydre Apr 3, 2026
a8b8383
update pci drivers
elydre Apr 3, 2026
d852615
Update e1000.c
elydre Apr 3, 2026
8bc22fd
disown
elydre Apr 3, 2026
119ecfb
add @asqel to authors
elydre Apr 3, 2026
df5fdc2
change command name
elydre Apr 3, 2026
4520e93
update
elydre Apr 3, 2026
35046aa
aled
elydre Apr 3, 2026
8642278
dns
asqel Apr 3, 2026
e7ee905
aa
asqel Apr 3, 2026
324058a
MSG_PEEK
asqel Apr 3, 2026
4161cf0
Update stp.c
elydre Apr 4, 2026
d38c72f
improver
elydre Apr 4, 2026
54de42f
Update .gitignore
elydre Apr 4, 2026
6e371e3
Update README.md
elydre Apr 4, 2026
cab2e86
Delete recv.man
elydre Apr 4, 2026
0853c79
Update system.h
elydre Apr 4, 2026
1283224
update
elydre Apr 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:

- name: build img
run: |
make elf bdisk iso
make kernel bdisk iso
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ jobs:
echo "PROFAN_HDD=disk-$VERSION.bin" >> $GITHUB_ENV
echo "PROFAN_ISO=profanOS-$VERSION.iso" >> $GITHUB_ENV
echo "PROFAN_VER=profanOS $VERSION" >> $GITHUB_ENV
make gaddons elf bdisk iso
make gaddons kernel bdisk iso
cd out/disk && zip -r ../../initrd-build.zip * && cd ../..
cp initrd.bin disk-$VERSION.bin
cp profanOS.iso profanOS-$VERSION.iso
cp kernel.elf profanOS-kernel.elf
mv initrd.bin profanOS-initrd.bin
rm -Rf out/ && make elf disk && sh tools/limine.sh
rm -Rf out/ && make kernel disk && sh tools/limine.sh
mv profanOS.iso profanOS-lite.iso
cp profanOS-$VERSION.iso profanOS.iso

Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ include/addons/
.vscode/
.vs/

# vim swap files
*.swp

# clangd indexing data
.cache/
compile_commands.json
Expand All @@ -33,3 +36,4 @@ extracted/
debug/
*.hex
*.out
*.dat
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,20 @@
# === elydre : https://github.com/elydre/profanOS === ####### \\ #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

.PHONY: help elf iso miso disk bdisk run krun srun clean fclean addons gaddons
.PHONY: _all help kernel iso miso disk bdisk run krun srun clean fclean addons gaddons run_ndbg

PY_BUILD = tools/maketool.py
PY_ADDON = tools/addons.py

_all: disk run

# list off available commands
help:
@python3 $(PY_BUILD) help

# build kernel
elf:
python3 $(PY_BUILD) elf
kernel:
python3 $(PY_BUILD) kernel

# create iso with grub
iso:
Expand Down Expand Up @@ -50,6 +52,9 @@ krun:
srun:
python3 $(PY_BUILD) srun

run_ndbg:
python3 $(PY_BUILD) run_ndbg

# install all addons
addons:
python3 $(PY_ADDON) -g
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ sudo pacman -S make python gcc nasm qemu-full xorriso \
make run

# Show all commands
make
make help
```

Each time the disk is modified you must force its reconstruction with `make disk`.
Expand Down Expand Up @@ -199,16 +199,16 @@ sudo sh install.sh /dev/sdX profanOS.iso
3. *Discontinued desktop environment for profanOS*
4. *The doom port running in profanOS*

### Author & Contact
### Authors & Contact

- pf4 ([@elydre](https://github.com/elydre))
- asqel ([@asqel](https://github.com/asqel))

Contact me on my discord [server](https://discord.gg/PFbymQ3d97) or in PM `@pf4`

### Source & Acknowledgment

- **[os tutorial](https://github.com/cfenollosa/os-tutorial) for the original tutorial**
- [@asqel](https://github.com/asqel) for tests, the sulfur language and all the ports
- [@Sarah](https://github.com/Sarenard) for all the help and ideas
- [@copy](https://github.com/copy/v86) for the v86 online emulator and floppy build
- [@spaskalev](https://github.com/spaskalev/buddy_alloc) for the buddy allocator
Expand Down
60 changes: 60 additions & 0 deletions include/kernel/drivers/pci.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*****************************************************************************\
| === pci.h : 2025 === |
| |
| Kernel PCI driver header .pi0iq. |
| d" . `'b |
| This file is part of profanOS and is released under q. /|\ " |
| the terms of the GNU General Public License `// \\ |
| // \\ |
| === elydre : https://github.com/elydre/profanOS === ####### \\ |
\*****************************************************************************/

#ifndef PCI_H
#define PCI_H

#include <ktype.h>

typedef struct {
int vendor_id;
int device_id;
int bus;
int slot;
int function;
uint8_t bar_is_mem[6];
uint32_t bar[6];
uint32_t class_id;
uint8_t subclass_id;
uint8_t prog_if;
uint8_t interrupt_line;
uint8_t interrupt_pin;
} pci_device_t;

typedef struct {
uint16_t vendor_id;
uint16_t device_id;
} pci_findme_t;

extern pci_device_t *pcis;
extern int pcis_len;

void pci_write_config(pci_device_t *pci, uint8_t offset, uint32_t value);
void pci_write_config_u16(pci_device_t *pci, uint8_t offset, uint16_t value);
uint32_t pci_read_config(pci_device_t *pci, uint32_t offset);
uint16_t pci_read_config_u16(pci_device_t *pci, uint8_t offset);

uint8_t pci_read_cmd_u8(pci_device_t *pci, uint8_t bar, uint32_t offset);
uint16_t pci_read_cmd_u16(pci_device_t *pci, uint8_t bar, uint32_t offset);
uint32_t pci_read_cmd_u32(pci_device_t *pci, uint8_t bar, uint32_t offset);
void pci_write_cmd_u8(pci_device_t *pci, uint8_t bar, uint32_t offset, uint8_t value);
void pci_write_cmd_u16(pci_device_t *pci, uint8_t bar, uint32_t offset, uint16_t value);
void pci_write_cmd_u32(pci_device_t *pci, uint8_t bar, uint32_t offset, uint32_t value);

pci_device_t *pci_find(uint16_t vendor, uint16_t device);
pci_device_t *pci_find_array(pci_findme_t *ids, int count);

void pci_enable_bus_master(pci_device_t *pci);
uint32_t pci_try_enable_msi(pci_device_t *pci);

int pci_init();

#endif
17 changes: 10 additions & 7 deletions include/kernel/kernel/process.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@
#define PROC_STATE_RUN 4
#define PROC_STATE_IDL 5

#define PROC_INFO_PPID 0
#define PROC_INFO_STATE 1
#define PROC_INFO_SLEEP_TO 2
#define PROC_INFO_RUN_TIME 3
#define PROC_INFO_NAME 4
#define PROC_INFO_STACK 5
#define PROC_INFO_SET_NAME 6
#define PROC_INFO_PPID 0
#define PROC_INFO_SET_PPID 1
#define PROC_INFO_WAIT_PID 2
#define PROC_INFO_RET_CODE 3
#define PROC_INFO_STATE 4
#define PROC_INFO_SLEEP_TO 5
#define PROC_INFO_RUN_TIME 6
#define PROC_INFO_NAME 7
#define PROC_INFO_STACK 8
#define PROC_INFO_SET_NAME 9

#define process_get_ppid(pid) process_info(pid, PROC_INFO_PPID, NULL)
#define process_get_state(pid) process_info(pid, PROC_INFO_STATE, NULL)
Expand Down
3 changes: 2 additions & 1 deletion include/kernel/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

// build settings

#define KERNEL_VERSION "1.3.3"
#define KERNEL_VERSION "1.3.4"
#define KERNEL_EDITING "generic"

#define PROCESS_MAX 200 // max process count
Expand Down Expand Up @@ -69,6 +69,7 @@ int elf_start(char *file, int sleep, char **argv, int *pid_ptr);
// pok.c
int mod_load(char *path, uint32_t lib_id);
int mod_unload(uint32_t lib_id);
int mod_trigger_atdeath(int pid);
uint32_t mod_get_func(uint32_t lib_id, uint32_t func_id);

#define sys_fatal(msg, ...) sod_fatal(__FILE__, __LINE__, msg, ##__VA_ARGS__)
Expand Down
26 changes: 26 additions & 0 deletions include/zlibs/arpa/inet.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*****************************************************************************\
| === inet.h : 2025 === |
| |
| Implementation of the arpa/inet.h header file from libC .pi0iq. |
| d" . `'b |
| This file is part of profanOS and is released under q. /|\ " |
| the terms of the GNU General Public License `// \\ |
| // \\ |
| === elydre : https://github.com/elydre/profanOS === ####### \\ |
\*****************************************************************************/

#ifndef INET_H
#define INET_H

#include <stdint.h>
#include <netinet/in.h>

uint32_t htonl(uint32_t hostlong);
uint16_t htons(uint16_t hostshort);
uint32_t ntohl(uint32_t netlong);
uint16_t ntohs(uint16_t netshort);

int inet_aton(const char *str, struct in_addr *dest);
int inet_pton(int af, const char *s, void *a0);

#endif
100 changes: 100 additions & 0 deletions include/zlibs/modules/eth.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/*****************************************************************************\
| === eth.h : 2026 === |
| |
| Ethernet kernel module header .pi0iq. |
| d" . `'b |
| This file is part of profanOS and is released under q. /|\ " |
| the terms of the GNU General Public License `// \\ |
| // \\ |
| === elydre : https://github.com/elydre/profanOS === ####### \\ |
\*****************************************************************************/

#ifndef ETH_ID
#define ETH_ID 6

#include <stdint.h>

typedef struct eth_info_t {
uint32_t net_mask;
uint32_t router_ip;
uint8_t router_mac[8]; // ignores last 2 bytes

uint32_t ip;
uint8_t mac[8]; // ignores last 2 bytes
} eth_info_t;

typedef struct {
int len;
uint8_t *data;
} eth_packet_t;

typedef struct eth_listener_t {
int pid;
int len;
eth_packet_t *packets;
uint32_t id;
} eth_listener_t;

// syscalls

#ifndef _KERNEL_MODULE

uint32_t modeth_start();
void modeth_end(uint32_t id);
int modeth_send(void *data, uint16_t len);
int modeth_is_ready(uint32_t id);
void modeth_recv(uint32_t id, void *data);
void modeth_get_info(uint32_t id, struct eth_info_t *info);
void modeth_set_info(uint32_t id, struct eth_info_t *info);
uint32_t modeth_get_transaction();

extern int profan_syscall(uint32_t id, ...);

#undef _pscall
#define _pscall(module, id, ...) \
profan_syscall(((module << 24) | id), __VA_ARGS__)

#define modeth_start() ((uint32_t) _pscall(ETH_ID, 0, 0))
#define modeth_end(id) ((void) _pscall(ETH_ID, 1, id))
#define modeth_send(data, len) ((int) _pscall(ETH_ID, 2, data, len))
#define modeth_is_ready(id) ((int) _pscall(ETH_ID, 3, id))
#define modeth_recv(id, data) ((void) _pscall(ETH_ID, 4, id, data))
#define modeth_get_info(id, info) ((void) _pscall(ETH_ID, 5, id, info))
#define modeth_set_info(id, info) ((void) _pscall(ETH_ID, 6, id, info))
#define modeth_get_transaction() ((uint32_t) _pscall(ETH_ID, 7, 0))

#else // _KERNEL_MODULE defined

void eth_recv_packet(const void *addr, uint16_t p_len);
void eth_register_nic(int (*on_send)(const void *addr_phys, uint16_t len), const uint8_t *mac);

uint32_t eth_start();
void eth_end(uint32_t id);
int eth_send(void *data, uint16_t len);
int eth_is_ready(uint32_t id);
void eth_recv(uint32_t id, void *data);
void eth_get_info(uint32_t id, struct eth_info_t *info);
void eth_set_info(uint32_t id, struct eth_info_t *info);
uint32_t eth_get_transaction();

#ifndef _ETH_C

#undef get_func_addr
#define get_func_addr ((uint32_t (*)(uint32_t, uint32_t)) *(uint32_t *) 0x1ffffb)

#define eth_start ((uint32_t (*)(void)) get_func_addr(ETH_ID, 0))
#define eth_end ((void (*)(uint32_t)) get_func_addr(ETH_ID, 1))
#define eth_send ((int (*)(void *, uint16_t)) get_func_addr(ETH_ID, 2))
#define eth_is_ready ((int (*)(uint32_t)) get_func_addr(ETH_ID, 3))
#define eth_recv ((void (*)(uint32_t, void *)) get_func_addr(ETH_ID, 4))
#define eth_get_info ((void (*)(uint32_t, struct eth_info_t *)) get_func_addr(ETH_ID, 5))
#define eth_set_info ((void (*)(uint32_t, struct eth_info_t *)) get_func_addr(ETH_ID, 6))
#define eth_get_transaction ((uint32_t (*)(void)) get_func_addr(ETH_ID, 7))

#define eth_recv_packet ((void (*)(const void *, uint16_t)) get_func_addr(ETH_ID, 8))
#define eth_register_nic ((void (*)(int (*)(const void *, uint16_t), const uint8_t *)) get_func_addr(ETH_ID, 9))

#endif // _ETH_C
#endif // _KERNEL_MODULE

#endif
Loading
Loading