b083b7ff6e
- Implement PCI Bus Controller (drivers/pci.c, include/airlys/pci.h) with Type 1 config mechanism (0xCF8/0xCFC) - Implement IPv4 packet framing, checksum calculation, and protocol routing (net/ipv4.c) - Implement ICMP Echo Request/Reply ping engine (net/icmp.c) - Implement UDP transmission and reception (net/udp.c) - Implement TCP SYN handshake connection initiator (net/tcp.c) - Implement DHCPDISCOVER client broadcasting (net/dhcp.c) - Implement native embedded AiraLang bytecode VM & runtime v1.4.0 (kernel/airalang.c, include/airlys/airalang.h) - Add /home/user/demo.aira sample script to RamFS initramfs - Wire commands to airlys-sh shell: pci, ping, dhcp, airalang, airarun - Zero-warning freestanding verification with clang & ld.lld (bin/airlys.elf: 814 KB) Co-Authored-By: Er. Adam Eehan <adameehanairagroup@gmail.com> Co-Authored-By: Sovereign AI Aira 3 Ultra (Engine v3.6)
44 lines
1.0 KiB
C
44 lines
1.0 KiB
C
#ifndef AIRLYS_IO_H
|
|
#define AIRLYS_IO_H
|
|
|
|
#include <airlys/types.h>
|
|
|
|
/* Direct Hardware I/O Port operations */
|
|
|
|
static inline void outb(uint16_t port, uint8_t val) {
|
|
__asm__ volatile ("outb %0, %1" : : "a"(val), "Nd"(port));
|
|
}
|
|
|
|
static inline uint8_t inb(uint16_t port) {
|
|
uint8_t ret;
|
|
__asm__ volatile ("inb %1, %0" : "=a"(ret) : "Nd"(port));
|
|
return ret;
|
|
}
|
|
|
|
static inline void outw(uint16_t port, uint16_t val) {
|
|
__asm__ volatile ("outw %0, %1" : : "a"(val), "Nd"(port));
|
|
}
|
|
|
|
static inline uint16_t inw(uint16_t port) {
|
|
uint16_t ret;
|
|
__asm__ volatile ("inw %1, %0" : "=a"(ret) : "Nd"(port));
|
|
return ret;
|
|
}
|
|
|
|
static inline void outl(uint16_t port, uint32_t val) {
|
|
__asm__ volatile ("outl %0, %1" : : "a"(val), "Nd"(port));
|
|
}
|
|
|
|
static inline uint32_t inl(uint16_t port) {
|
|
uint32_t ret;
|
|
__asm__ volatile ("inl %1, %0" : "=a"(ret) : "Nd"(port));
|
|
return ret;
|
|
}
|
|
|
|
/* Wait for I/O operations to complete */
|
|
static inline void io_wait(void) {
|
|
outb(0x80, 0);
|
|
}
|
|
|
|
#endif /* AIRLYS_IO_H */
|