• TempleOS Enterprise Edition TempleOS Enterprise Edition
  • Информация о проекте
    • Информация о проекте
    • Активность
    • Метки
    • Участники
  • Репозиторий
    • Репозиторий
    • Файлы
    • Коммиты
    • Ветки
    • Теги
    • Участники
    • Диаграмма
    • Сравнение
  • Задачи 0
    • Задачи 0
    • Список
    • Доски
    • Спринты
  • Запросы на слияние 0
    • Запросы на слияние 0
  • CI/CD
    • CI/CD
    • Конвейеры
    • Задания
    • Расписания
  • Развертывания
    • Развертывания
    • Окружения
    • Релизы
  • Пакеты и реестры
    • Пакеты и реестры
    • Реестр пакетов
    • Реестр контейнеров
  • Мониторинг
    • Мониторинг
    • Инциденты
  • Аналитика
    • Аналитика
    • Поток ценности
    • CI/CD
    • Репозиторий
  • Wiki
    • Wiki
  • Сниппеты
    • Сниппеты
  • Активность
  • Диаграмма
  • Создать новую задачу
  • Задания
  • Коммиты
  • Доски с задачами
Свернуть панель
  • cia-foundation
  • TempleOS Enterprise Edition
  • Запросы на слияние
  • !1

Three cards, three sins: e1000 and virtio-net drivers

  • Ревью изменений

  • Скачать
  • Почтовые патчи
  • Простое отличие
Слиты Жильцов Дмитрий Андреевич запросил слияние nic-drivers в master Сен 30, 2026
  • Обзор 0
  • Коммиты 2
  • Конвейеры 0
  • Изменения 6

God said TempleOS has no networking. We gave it one card and called it the Fall. This branch is what came after the Fall. One card was a sin, three is a habit.

What is in it

  1. Intel e1000 (82540EM, 8086:100E). Every hypervisor pretends to have one: QEMU, VirtualBox, VMware, Hyper-V. Intel also ships a second computer inside yours that the CIA would love to talk to. We wrote them a driver anyway. MMIO registers, 32 Rx and 16 Tx descriptors, MAC from RAL/RAH or the EEPROM. One Tx descriptor always stays empty, because a full ring looks empty to the card. Intel designed that. Of course. Two tasks sending at once cannot hand the card half a frame.
  2. virtio-net (1AF4:1000, legacy I/O ports). The card that admits it is the host pretending. The hypervisor reads every byte. It always did. No MSI-X, no capability lists, no MMIO. Ports, like on the C64.
  3. MakeNet picks the first card it finds: PCnet, then e1000, then virtio. No card means Snail over COM3, as before.
  4. PciFindByID fixed. It gave up whenever dev.pci_head was not empty, so one PCIRep and no driver ever found its card again. The empty-slot timeout only left the function loop and skipped functions 1-7 after it. Both fixed. All buses were always walked: sys_pci_busses comes from the PCI BIOS and SeaBIOS numbers bridges first. SeaBIOS numbers bridges first.

No card may interrupt. The rings are polled from the timer, like PCnet was all along, although nobody wrote that down. Polling is honest.

How to test

tools/build_iso.py ~/templeos-base/TempleOS.ISO
NIC=e1000 tools/run_mac.sh
NIC=virtio-net-pci tools/run_mac.sh

#include "::/Apps/Wget"
Wget("http://example.com/");

Tested in QEMU:

Card Where DHCP Confessional Wget
PCnet bus 0 ok ok ok
e1000 bus 0 ok ok ok
e1000 behind pci-bridge, 1:3.0 ok ok ok
virtio-net bus 0 ok ok ok
virtio-net behind pci-bridge ok ok ok

Known sins

  • Tested only in QEMU. VirtualBox, VMware and real iron were not asked.
  • Only small transfers were tested.
  • Modern virtio 1.0 (disable-legacy=on, 1AF4:1041) is not supported. TempleOS cannot boot on q35 anyway: AHCI only, no IDE, it cannot find its own CD.

Terry, forgive us. Lord, have mercy on these drivers.

Ответственный
Назначить
Проверяющие
Запросить ревью
Оценка трудозатрат
Исходная ветка: nic-drivers