Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit 1b97899

Browse files
author
Gao feng
committed
Add VirtualBox support
Run hyperStart on VirtualBox Signed-off-by: Gao feng <[email protected]>
1 parent 46ffda7 commit 1b97899

23 files changed

+2538
-269
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ init
1111
build/hyper_daemon
1212
build/hyper-initrd.img
1313
build/root/*
14+
build/*iso
1415
build/daemon
1516
build/.*
1617
src/.*

Makefile.am

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
SUBDIRS=src build
2+
3+
initrd-local:
4+
@echo finish make initrd

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,13 @@ clone this repo, and make sure have build-essentials installed. Go into the work
1111
> make
1212

1313
Then you can find `hyper-initrd.img` in build directory, together with a pre-build kernel.
14+
15+
If you want to get the boot disk file for VirtaulBox, please reconfigure with flag --with-vbox,
16+
17+
> ./configure --with-vbox
18+
> make
19+
20+
Note: This will need you to input your password to mount pseudo vbox image.
21+
22+
Then you can find `hyper-vbox-bootimage.iso` in build directory, booting from this iso will
23+
bring you to the hyper world.

build/Makefile.am

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
bin_PROGRAMS=hyper_daemon
22
hyper_daemon_SOURCES=hyper_daemon.c ../src/net.c
3-
all-local:
4-
bash ./make-initrd.sh
3+
all-local: initrd
54

6-
cbfs-local:
5+
if WITH_VBOX
6+
initrd-local:
7+
bash ./make-initrd.sh vbox
8+
else
9+
initrd-local:
10+
bash ./make-initrd.sh
11+
cbfs:
712
bash ./make-initrd.sh cbfs
13+
endif

build/kernel

-29.5 KB
Binary file not shown.

build/kernel_config

Lines changed: 75 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,7 @@ CONFIG_GENERIC_EARLY_IOREMAP=y
432432
# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
433433
CONFIG_X86_RESERVE_LOW=64
434434
CONFIG_MTRR=y
435-
CONFIG_MTRR_SANITIZER=y
436-
CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0
437-
CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
435+
# CONFIG_MTRR_SANITIZER is not set
438436
CONFIG_X86_PAT=y
439437
CONFIG_ARCH_USES_PG_UNCACHED=y
440438
CONFIG_ARCH_RANDOM=y
@@ -585,29 +583,24 @@ CONFIG_PACKET=y
585583
# CONFIG_PACKET_DIAG is not set
586584
CONFIG_UNIX=y
587585
# CONFIG_UNIX_DIAG is not set
588-
CONFIG_XFRM=y
589586
# CONFIG_XFRM_USER is not set
590-
# CONFIG_XFRM_SUB_POLICY is not set
591-
# CONFIG_XFRM_MIGRATE is not set
592-
# CONFIG_XFRM_STATISTICS is not set
593587
# CONFIG_NET_KEY is not set
594588
CONFIG_INET=y
595589
# CONFIG_IP_MULTICAST is not set
596590
# CONFIG_IP_ADVANCED_ROUTER is not set
597591
# CONFIG_IP_PNP is not set
598592
# CONFIG_NET_IPIP is not set
599593
# CONFIG_NET_IPGRE_DEMUX is not set
600-
CONFIG_NET_IP_TUNNEL=y
594+
# CONFIG_NET_IP_TUNNEL is not set
601595
# CONFIG_SYN_COOKIES is not set
602596
# CONFIG_NET_UDP_TUNNEL is not set
603597
# CONFIG_NET_FOU is not set
604-
# CONFIG_NET_FOU_IP_TUNNELS is not set
605598
# CONFIG_GENEVE is not set
606599
# CONFIG_INET_AH is not set
607600
# CONFIG_INET_ESP is not set
608601
# CONFIG_INET_IPCOMP is not set
609602
# CONFIG_INET_XFRM_TUNNEL is not set
610-
CONFIG_INET_TUNNEL=y
603+
# CONFIG_INET_TUNNEL is not set
611604
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
612605
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
613606
# CONFIG_INET_XFRM_MODE_BEET is not set
@@ -626,14 +619,11 @@ CONFIG_IPV6=y
626619
# CONFIG_IPV6_MIP6 is not set
627620
# CONFIG_INET6_XFRM_TUNNEL is not set
628621
# CONFIG_INET6_TUNNEL is not set
629-
CONFIG_INET6_XFRM_MODE_TRANSPORT=y
630-
CONFIG_INET6_XFRM_MODE_TUNNEL=y
631-
CONFIG_INET6_XFRM_MODE_BEET=y
622+
# CONFIG_INET6_XFRM_MODE_TRANSPORT is not set
623+
# CONFIG_INET6_XFRM_MODE_TUNNEL is not set
624+
# CONFIG_INET6_XFRM_MODE_BEET is not set
632625
# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
633-
# CONFIG_IPV6_VTI is not set
634-
CONFIG_IPV6_SIT=y
635-
# CONFIG_IPV6_SIT_6RD is not set
636-
CONFIG_IPV6_NDISC_NODETYPE=y
626+
# CONFIG_IPV6_SIT is not set
637627
# CONFIG_IPV6_TUNNEL is not set
638628
# CONFIG_IPV6_GRE is not set
639629
# CONFIG_IPV6_MULTIPLE_TABLES is not set
@@ -730,7 +720,7 @@ CONFIG_GENERIC_CPU_AUTOPROBE=y
730720
CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
731721
# CONFIG_PARPORT is not set
732722
CONFIG_PNP=y
733-
CONFIG_PNP_DEBUG_MESSAGES=y
723+
# CONFIG_PNP_DEBUG_MESSAGES is not set
734724

735725
#
736726
# Protocols
@@ -758,7 +748,6 @@ CONFIG_BLK_DEV_RAM_SIZE=16384
758748
# CONFIG_CDROM_PKTCDVD is not set
759749
# CONFIG_ATA_OVER_ETH is not set
760750
CONFIG_XEN_BLKDEV_FRONTEND=y
761-
# CONFIG_XEN_BLKDEV_BACKEND is not set
762751
CONFIG_VIRTIO_BLK=y
763752
# CONFIG_BLK_DEV_HD is not set
764753
# CONFIG_BLK_DEV_RBD is not set
@@ -943,7 +932,69 @@ CONFIG_VIRTIO_NET=y
943932
# CONFIG_NET_DSA_MV88E6171 is not set
944933
# CONFIG_NET_DSA_MV88E6352 is not set
945934
# CONFIG_NET_DSA_BCM_SF2 is not set
946-
# CONFIG_ETHERNET is not set
935+
CONFIG_ETHERNET=y
936+
# CONFIG_NET_VENDOR_3COM is not set
937+
# CONFIG_NET_VENDOR_ADAPTEC is not set
938+
# CONFIG_NET_VENDOR_AGERE is not set
939+
# CONFIG_NET_VENDOR_ALTEON is not set
940+
# CONFIG_ALTERA_TSE is not set
941+
# CONFIG_NET_VENDOR_AMD is not set
942+
# CONFIG_NET_XGENE is not set
943+
# CONFIG_NET_VENDOR_ARC is not set
944+
# CONFIG_NET_VENDOR_ATHEROS is not set
945+
# CONFIG_NET_VENDOR_BROADCOM is not set
946+
# CONFIG_NET_VENDOR_BROCADE is not set
947+
# CONFIG_NET_VENDOR_CHELSIO is not set
948+
# CONFIG_NET_VENDOR_CISCO is not set
949+
# CONFIG_CX_ECAT is not set
950+
# CONFIG_DNET is not set
951+
# CONFIG_NET_VENDOR_DEC is not set
952+
# CONFIG_NET_VENDOR_DLINK is not set
953+
# CONFIG_NET_VENDOR_EMULEX is not set
954+
# CONFIG_NET_VENDOR_EXAR is not set
955+
# CONFIG_NET_VENDOR_HP is not set
956+
CONFIG_NET_VENDOR_INTEL=y
957+
# CONFIG_E100 is not set
958+
CONFIG_E1000=y
959+
# CONFIG_E1000E is not set
960+
# CONFIG_IGB is not set
961+
# CONFIG_IGBVF is not set
962+
# CONFIG_IXGB is not set
963+
# CONFIG_IXGBE is not set
964+
# CONFIG_IXGBEVF is not set
965+
# CONFIG_I40E is not set
966+
# CONFIG_I40EVF is not set
967+
# CONFIG_FM10K is not set
968+
# CONFIG_NET_VENDOR_I825XX is not set
969+
# CONFIG_IP1000 is not set
970+
# CONFIG_JME is not set
971+
# CONFIG_NET_VENDOR_MARVELL is not set
972+
# CONFIG_NET_VENDOR_MELLANOX is not set
973+
# CONFIG_NET_VENDOR_MICREL is not set
974+
# CONFIG_NET_VENDOR_MYRI is not set
975+
# CONFIG_FEALNX is not set
976+
# CONFIG_NET_VENDOR_NATSEMI is not set
977+
# CONFIG_NET_VENDOR_NVIDIA is not set
978+
# CONFIG_NET_VENDOR_OKI is not set
979+
# CONFIG_ETHOC is not set
980+
# CONFIG_NET_PACKET_ENGINE is not set
981+
# CONFIG_NET_VENDOR_QLOGIC is not set
982+
# CONFIG_NET_VENDOR_QUALCOMM is not set
983+
# CONFIG_NET_VENDOR_REALTEK is not set
984+
# CONFIG_NET_VENDOR_RDC is not set
985+
# CONFIG_NET_VENDOR_ROCKER is not set
986+
# CONFIG_NET_VENDOR_SAMSUNG is not set
987+
# CONFIG_NET_VENDOR_SEEQ is not set
988+
# CONFIG_NET_VENDOR_SILAN is not set
989+
# CONFIG_NET_VENDOR_SIS is not set
990+
# CONFIG_SFC is not set
991+
# CONFIG_NET_VENDOR_SMSC is not set
992+
# CONFIG_NET_VENDOR_STMICRO is not set
993+
# CONFIG_NET_VENDOR_SUN is not set
994+
# CONFIG_NET_VENDOR_TEHUTI is not set
995+
# CONFIG_NET_VENDOR_TI is not set
996+
# CONFIG_NET_VENDOR_VIA is not set
997+
# CONFIG_NET_VENDOR_WIZNET is not set
947998
# CONFIG_FDDI is not set
948999
# CONFIG_HIPPI is not set
9491000
# CONFIG_NET_SB1000 is not set
@@ -961,7 +1012,6 @@ CONFIG_VIRTIO_NET=y
9611012
#
9621013
# CONFIG_WAN is not set
9631014
CONFIG_XEN_NETDEV_FRONTEND=y
964-
# CONFIG_XEN_NETDEV_BACKEND is not set
9651015
# CONFIG_VMXNET3 is not set
9661016
# CONFIG_ISDN is not set
9671017

@@ -995,17 +1045,8 @@ CONFIG_INPUT=y
9951045
#
9961046
# Hardware I/O ports
9971047
#
998-
CONFIG_SERIO=y
1048+
# CONFIG_SERIO is not set
9991049
CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
1000-
CONFIG_SERIO_I8042=y
1001-
CONFIG_SERIO_SERPORT=y
1002-
# CONFIG_SERIO_CT82C710 is not set
1003-
# CONFIG_SERIO_PCIPS2 is not set
1004-
CONFIG_SERIO_LIBPS2=y
1005-
CONFIG_SERIO_RAW=m
1006-
# CONFIG_SERIO_ALTERA_PS2 is not set
1007-
# CONFIG_SERIO_PS2MULT is not set
1008-
# CONFIG_SERIO_ARC_PS2 is not set
10091050
# CONFIG_GAMEPORT is not set
10101051

10111052
#
@@ -1216,14 +1257,13 @@ CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
12161257
#
12171258
# CONFIG_XEN_BALLOON is not set
12181259
# CONFIG_XEN_DEV_EVTCHN is not set
1219-
CONFIG_XEN_BACKEND=y
1260+
# CONFIG_XEN_BACKEND is not set
12201261
# CONFIG_XENFS is not set
12211262
# CONFIG_XEN_SYS_HYPERVISOR is not set
12221263
CONFIG_XEN_XENBUS_FRONTEND=y
12231264
# CONFIG_XEN_GNTDEV is not set
12241265
# CONFIG_XEN_GRANT_DEV_ALLOC is not set
12251266
CONFIG_SWIOTLB_XEN=y
1226-
CONFIG_XEN_PCIDEV_BACKEND=m
12271267
CONFIG_XEN_PRIVCMD=m
12281268
CONFIG_XEN_HAVE_PVMMU=y
12291269
# CONFIG_STAGING is not set
@@ -1385,7 +1425,7 @@ CONFIG_9P_FS_POSIX_ACL=y
13851425
CONFIG_9P_FS_SECURITY=y
13861426
CONFIG_NLS=y
13871427
CONFIG_NLS_DEFAULT="utf8"
1388-
CONFIG_NLS_CODEPAGE_437=m
1428+
# CONFIG_NLS_CODEPAGE_437 is not set
13891429
# CONFIG_NLS_CODEPAGE_737 is not set
13901430
# CONFIG_NLS_CODEPAGE_775 is not set
13911431
# CONFIG_NLS_CODEPAGE_850 is not set
@@ -1433,7 +1473,7 @@ CONFIG_NLS_CODEPAGE_437=m
14331473
# CONFIG_NLS_MAC_INUIT is not set
14341474
# CONFIG_NLS_MAC_ROMANIAN is not set
14351475
# CONFIG_NLS_MAC_TURKISH is not set
1436-
CONFIG_NLS_UTF8=m
1476+
# CONFIG_NLS_UTF8 is not set
14371477

14381478
#
14391479
# Kernel hacking

build/make-initrd.sh

Lines changed: 45 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,55 @@ do
1818
fi
1919
done
2020
done
21+
22+
if [ "$1"x = "vbox"x ]; then
23+
echo "build initrd for vbox"
24+
cp ./vbox/driver/* ./root
25+
fi
26+
2127
cd ./root && find . | cpio -H newc -o | gzip -9 > ../hyper-initrd.img
2228

29+
cd ../
30+
rm -rf ./root
31+
32+
if [ "$1"x = "cbfs"x ]; then
33+
echo "build cbfs"
34+
rm -rf .cbfs
35+
rm -rf cbfs.rom
2336

24-
if [ "$1" != "cbfs" ]; then
37+
mkdir .cbfs
38+
dd if=/dev/zero of=.cbfs/boot.bin bs=4096 count=1
39+
cbfstool .cbfs/cbfs.rom create -s 4096k -B .cbfs/boot.bin -m x86 0x1000
40+
cbfstool .cbfs/cbfs.rom add -f kernel -n vmlinuz -t raw
41+
cbfstool .cbfs/cbfs.rom add -f hyper-initrd.img -n initrd -t raw
42+
cp .cbfs/cbfs.rom ./
43+
rm -rf .cbfs
2544
exit 0
2645
fi
2746

28-
cd ../
47+
if [ "$1"x = "vbox"x ]; then
48+
mkdir tmp
49+
mkdir -p tmp/images
50+
mkdir -p tmp/kernel
51+
mkdir -p tmp/isolinux
2952

30-
echo "build cbfs"
31-
rm -rf .cbfs
32-
rm -rf cbfs.rom
33-
34-
mkdir .cbfs
35-
dd if=/dev/zero of=.cbfs/boot.bin bs=4096 count=1
36-
cbfstool .cbfs/cbfs.rom create -s 4096k -B .cbfs/boot.bin -m x86 0x1000
37-
cbfstool .cbfs/cbfs.rom add -f kernel -n vmlinuz -t raw
38-
cbfstool .cbfs/cbfs.rom add -f hyper-initrd.img -n initrd -t raw
39-
cp .cbfs/cbfs.rom ./
40-
rm -rf .cbfs
53+
cd tmp
54+
cp ../vbox/kernel ./kernel/
55+
cp ../hyper-initrd.img ./images/initrd.img
56+
cp ../vbox/isolinux/isolinux.bin ./isolinux/
57+
cp ../vbox/isolinux/ldlinux.c32 ./isolinux/
58+
59+
cat > isolinux/syslinux.cfg <<EOF
60+
DEFAULT linux
61+
LABEL linux
62+
SAY Now booting the kernel from SYSLINUX...
63+
KERNEL /kernel/kernel
64+
APPEND initrd=/images/initrd.img
65+
EOF
66+
67+
cd ../
68+
69+
mkisofs -o hyper-vbox-boot.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table tmp
70+
71+
rm -fr tmp
72+
fi

build/vbox/driver/vboxguest.ko

381 KB
Binary file not shown.

build/vbox/driver/vboxsf.ko

62.8 KB
Binary file not shown.

build/vbox/isolinux/isolinux.bin

44 KB
Binary file not shown.

0 commit comments

Comments
 (0)