展示 HN:适用于云应用程序的 10KiB 内核
Show HN: A 10KiB kernel for cloud apps

原始链接: https://github.com/ReturnInfinity/BareMetal-Cloud

## 裸金属云 概要 裸金属云是一个为云实例设计的极简内核(目前在 Digital Ocean 和 Proxmox 上测试,计划扩展支持)。它体积非常小 – 仅 10KB – 且仅使用 4MB 内存,从而最大限度地为负载提供资源。 实时演示可在 [http://baremetal.returninfinity.com](http://baremetal.returninfinity.com) 找到。 入门需要基于 Debian 的 Linux 系统(或带有 Homebrew 的 macOS)以及 NASM、QEMU 和 Git 等工具。 设置脚本 (`baremetal.sh setup`) 会构建、安装和测试系统,创建一个 `.vmdk` 磁盘镜像。 部署涉及将此镜像作为自定义镜像上传到 Digital Ocean,或通过 `qm importdisk` 导入到 Proxmox。 裸金属云随后直接在所选平台上运行,为自定义应用程序提供轻量级且高效的基础。

Hacker News 新闻 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 展示 HN:适用于云应用程序的 10KiB 内核 (github.com/returninfinity) 12 分,作者 ianseyler 58 分钟前 | 隐藏 | 过去 | 收藏 | 1 条评论 bflesch 10 分钟前 [–] 抱歉这可能是一个非常愚蠢的问题,但你能解释一下这个项目的优势以及其他(更大的?)替代方案是什么吗? 我理解这个“外核”为软件提供更高效的硬件访问,并且似乎是用汇编语言从头编写的。 这是否意味着应该预期很多安全性和鲁棒性问题,这意味着它应该只用于内部服务,而绝不能暴露在不受信任的网络上? 回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系方式 搜索:
相关文章

原文

Important

This has only been tested with Digital Ocean and Proxmox. Support for other hypervisor/cloud providers (AWS, Azure, and Google Cloud) is coming soon.

BareMetal Cloud is a minimal version of the BareMetal exokernel specifically geared for running in public/private cloud instances. This minimal version of BareMetal contains only the relevant drivers, is 10,240 bytes in size, and only uses 4 MiB of memory. All other memory is allocated to the payload.

An instance of BareMetal is running in Digital Ocean at http://baremetal.returninfinity.com and will respond to HTTP and ICMP.

The script in this repo depends on a Debian-based Linux system. macOS is also supported to build and test if you are using Homebrew.

  • NASM - Assembler to build the loader and kernel.
  • QEMU - Computer emulator if you plan on running a virtual machine for quick testing.
  • Git - Version control software for pulling the source code from GitHub.

In Linux this can be completed with the following command:

sudo apt install nasm qemu-system-x86 git

In macOS via Homebrew this can be completed with the following command:

brew install nasm qemu git

BareMetal Cloud consists of two different projects:

git clone https://github.com/ReturnInfinity/BareMetal-Cloud.git
cd BareMetal-Cloud
./baremetal.sh setup

baremetal.sh setup automatically runs the build and install functions. Once the setup is complete you can execute baremetal.sh run to verify that everything installed correctly.

This command builds the boot sector, loader (Pure64), and kernel

This command installs the software to the disk image.

This command will run BareMetal-Cloud in a QEMU VM. Output to the serial port will be displayed to the console.

Create a VMDK disk image

The resulting BareMetal_Cloud.vmdk in sys/ will be required.

In Digital Ocean click on Backups & Snapshots and then Custom Images. Click on the Upload Image button and select the .vmdk file on your filesystem. Once the file is uploaded you can start a droplet of it by clicking on the More dropdown and selecting Start a droplet.

On the Create Droplets page you can select the Droplet Type and CPU Options. Give the droplet a name and click on Create Droplet.

In Proxmox click on the "Create VM" button. Configure the following settings:

  • General - Give the VM a name
  • OS - "Do not use any media"
  • System - Machine: q35
  • Disks - Remove the existing disk
  • CPU - Provision as needed
  • Memory - Provision as needed
  • Network - Model: VirtIO
  • Confirm - Click "Finish"

Use a utility like scp to copy the .vmdk file to the filesystem of the Proxmox server.

qm importdisk <VMID> <vmdk_filename> <storage_location>

Example - qm importdisk 101 /root/BareMetal_Cloud.vmdk local-lvm

In the Proxmox web interface select the new VM. In the Hardware section, find the new unused disk, and attach it to the VM.

Verify the "Boot Order" in the VM "Options".

Click "Start" on the VM.

//EOF

联系我们 contact @ memedata.com