Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ssrg-vt/rumprun-smp
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: abhishekbapat/rumprun-smp
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 10 commits
  • 14 files changed
  • 2 contributors

Commits on Mar 13, 2021

  1. Copy the full SHA
    9989baa View commit details
  2. Copy the full SHA
    93dd8ab View commit details
  3. fix: logic

    abhishekbapat committed Mar 13, 2021
    Copy the full SHA
    c67289b View commit details

Commits on Mar 16, 2021

  1. chore: myapp (kvm-test)

    abhishekbapat committed Mar 16, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    495de01 View commit details
  2. Copy the full SHA
    1011a89 View commit details

Commits on Mar 19, 2021

  1. Copy the full SHA
    975f9bb View commit details

Commits on Jul 20, 2021

  1. feat: finally could boot using multiboot2

    abhishek authored and abhishekbapat committed Jul 20, 2021
    Copy the full SHA
    0a29f9f View commit details
  2. chore: scripts

    abhishek authored and abhishekbapat committed Jul 20, 2021
    Copy the full SHA
    865fdbc View commit details
  3. refactor: clean up

    abhishekbapat committed Jul 20, 2021
    Copy the full SHA
    dbbc9ee View commit details
  4. chore: clean up

    abhishekbapat committed Jul 20, 2021
    Copy the full SHA
    8a6dff5 View commit details
4 changes: 2 additions & 2 deletions app-tools/rumprun
Original file line number Diff line number Diff line change
@@ -780,9 +780,9 @@ bake_iso ()

# create the iso directory structure
mkdir -p "${ISODIR}/boot/grub"
printf 'set timeout=0\n' > "${ISODIR}/boot/grub/grub.cfg"
printf 'set timeout=10\n' > "${ISODIR}/boot/grub/grub.cfg"
printf 'menuentry "rumpkernel" {\n' >> "${ISODIR}/boot/grub/grub.cfg"
printf '\tmultiboot /boot/%s\n\tmodule /json.cfg cmdline\n}\n' \
printf '\tmultiboot2 /boot/%s\n\tmodule2 /json.cfg cmdline\n}\n' \
$(basename $1) >> "${ISODIR}/boot/grub/grub.cfg"
cp ${bootimage} "${ISODIR}/boot"
cp "${TMPDIR}/json.cfg" "${ISODIR}"
7 changes: 1 addition & 6 deletions app-tools/rumprun-bake.conf
Original file line number Diff line number Diff line change
@@ -142,10 +142,5 @@ fnoc

conf hw_generic
create "generic targets, includes (almost) all drivers"
assimilate _miconf \
_virtio \
_virtio_scsi \
_audio \
_pciether \
_usb
assimilate _miconf
fnoc
7 changes: 7 additions & 0 deletions myapp/build_iso.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

export PATH="${PATH}:$(pwd)/../rumprun/bin"

rm rumprun-myapp.bin.iso

rumprun iso myapp.bin
9 changes: 9 additions & 0 deletions myapp/compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

export PATH="${PATH}:$(pwd)/../rumprun-uefi_support/bin"

(cd src && x86_64-rumprun-netbsd-gcc -Wall -O2 -o ../myapp main.c -DPORTMAP -DRUMPRUN)

rumprun-bake hw_generic myapp.bin myapp

sudo ./build_iso.sh
8 changes: 8 additions & 0 deletions myapp/src/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include<stdio.h>

int main(){
printf("Hello world!");
return 0;
}


4 changes: 4 additions & 0 deletions myapp/start_kvm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

export PATH="${PATH}:$(pwd)/../rumprun/bin"
rumprun kvm -i -g '-nographic -vga none' -M 1024 myapp.bin
54 changes: 43 additions & 11 deletions platform/hw/arch/amd64/locore.S
Original file line number Diff line number Diff line change
@@ -27,26 +27,58 @@
#include <hw/kernel.h>
#include <hw/multiboot.h>

#define MYMULTIBOOT_FLAGS \
(MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO | MULTIBOOT_AOUT_KLUDGE)

.section .bootstrap, "ax"

.code32

.align 4
.align 8
.global _minios_hypercall_page, _kvm_pvclock_wc
_minios_hypercall_page:
_kvm_pvclock_wc:
bootstrap:
multiboot_header:
.long MULTIBOOT_HEADER_MAGIC
.long MYMULTIBOOT_FLAGS
.long -(MULTIBOOT_HEADER_MAGIC+MYMULTIBOOT_FLAGS)
.long bootstrap
.long 0x100000
.long _edata
.long _ebss
.long _start
.long MULTIBOOT_ARCHITECTURE_I386
.long multiboot_header_end - multiboot_header
.long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_ARCHITECTURE_I386 + (multiboot_header_end - multiboot_header))
.align 8
mbi_request_start:
.short MULTIBOOT_HEADER_TAG_INFORMATION_REQUEST
.short MULTIBOOT_HEADER_TAG_IMPORTANT
.long mbi_request_end - mbi_request_start
.long MULTIBOOT_TAG_TYPE_CMDLINE
.long MULTIBOOT_TAG_TYPE_MODULE
.long MULTIBOOT_TAG_TYPE_BASIC_MEMINFO
.long MULTIBOOT_TAG_TYPE_MMAP
mbi_request_end:
.align 8
address_tag_start:
.short MULTIBOOT_HEADER_TAG_ADDRESS
.short MULTIBOOT_HEADER_TAG_OPTIONAL
.long address_tag_end - address_tag_start
.long multiboot_header /* header_addr */
.long 0x100000 /* load_addr */
.long _edata /* load_end_addr */
.long _ebss /* bss_end_addr */
address_tag_end:
.align 8
entry_address_tag_start:
.short MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS
.short MULTIBOOT_HEADER_TAG_OPTIONAL
.long entry_address_tag_end - entry_address_tag_start
.long _start /* entry_addr */
entry_address_tag_end:
.align 8
module_alignment_tag_start:
.short MULTIBOOT_HEADER_TAG_MODULE_ALIGN
.short MULTIBOOT_HEADER_TAG_OPTIONAL
.long module_alignment_tag_end - module_alignment_tag_start
module_alignment_tag_end:
.align 8
.short MULTIBOOT_HEADER_TAG_END
.short 0
.long 8
multiboot_header_end:

/* Reserve space for the hypercall page. */
.org bootstrap + 0x1000
33 changes: 28 additions & 5 deletions platform/hw/arch/i386/locore.S
Original file line number Diff line number Diff line change
@@ -26,13 +26,36 @@
#include <hw/multiboot.h>
#include <hw/kernel.h>

#define MYMULTIBOOT_FLAGS (MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO)

.section .multiboot
.align 4

.align 8
bootstrap:
multiboot_header:
.long MULTIBOOT_HEADER_MAGIC
.long MYMULTIBOOT_FLAGS
.long -(MULTIBOOT_HEADER_MAGIC+MYMULTIBOOT_FLAGS)
.long MULTIBOOT_ARCHITECTURE_I386
.long multiboot_header_end - multiboot_header
.long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_ARCHITECTURE_I386 + (multiboot_header_end - multiboot_header))
.align 8
mbi_request_start:
.short MULTIBOOT_HEADER_TAG_INFORMATION_REQUEST
.short MULTIBOOT_HEADER_TAG_IMPORTANT
.long mbi_request_end - mbi_request_start
.long MULTIBOOT_TAG_TYPE_CMDLINE
.long MULTIBOOT_TAG_TYPE_MODULE
.long MULTIBOOT_TAG_TYPE_BASIC_MEMINFO
.long MULTIBOOT_TAG_TYPE_MMAP
mbi_request_end:
.align 8
module_alignment_tag_start:
.short MULTIBOOT_HEADER_TAG_MODULE_ALIGN
.short MULTIBOOT_HEADER_TAG_OPTIONAL
.long module_alignment_tag_end - module_alignment_tag_start
module_alignment_tag_end:
.align 8
.short MULTIBOOT_HEADER_TAG_END
.short 0
.long 8
multiboot_header_end:

.space 4096
bootstack:
2 changes: 1 addition & 1 deletion platform/hw/arch/x86/boot.c
Original file line number Diff line number Diff line change
@@ -368,7 +368,7 @@ static volatile int main_cpu_ready = 0;
struct bmk_cpu_info x86_cpu_info[BMK_MAXCPUS];

void
x86_boot(struct multiboot_info *mbi, unsigned long cpu)
x86_boot(unsigned long mbi, unsigned long cpu)
{
/* Other CPUs jumping from the trampoline. */
if (cpu) {
4 changes: 2 additions & 2 deletions platform/hw/include/arch/i386/md.h
Original file line number Diff line number Diff line change
@@ -20,8 +20,8 @@ void cpu_lgdt(struct region_descriptor *);

#include <arch/x86/inline.h>

struct multiboot_info;
void cpu_boot(struct multiboot_info *);
//struct multiboot_info;
void cpu_boot(unsigned long);
#endif /* !_LOCORE */

#endif /* _BMK..._H_ */
4 changes: 2 additions & 2 deletions platform/hw/include/arch/x86/var.h
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@
#define _RUMPRUN_X86_VAR_H 1

#ifndef _LOCORE
struct multiboot_info;
void x86_boot(struct multiboot_info *, unsigned long);
//struct multiboot_info;
void x86_boot(unsigned long, unsigned long);

void x86_initpic(void);
void x86_initidt(void);
4 changes: 2 additions & 2 deletions platform/hw/include/hw/kernel.h
Original file line number Diff line number Diff line change
@@ -4,8 +4,8 @@

#include <hw/types.h>

struct multiboot_info;
void multiboot(struct multiboot_info *);
//struct multiboot_info;
void multiboot(unsigned long);

void cons_init(void);
void cons_putc(int);
Loading