Skip to content

Commit

Permalink
Updates buildroot + switches from ISOs to directly booting a bzImage …
Browse files Browse the repository at this point in the history
…and a initramfs + makes the kernel even leaner
  • Loading branch information
alexkar598 committed Jun 22, 2024
1 parent 71d8f3a commit a41b280
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ testem.log
Thumbs.db

public/lib/rootfs.iso
public/lib/*.cpio*
public/lib/bzImage
2 changes: 1 addition & 1 deletion src/environments/environment.development.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const environment = {
isoUrl: './lib/rootfs.iso',
vmSourceUrl: './lib/',
};
2 changes: 1 addition & 1 deletion src/environments/environment.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const environment = {
isoUrl: 'https://spacestation13.github.io/dm-playground-linux/rootfs.iso9660',
vmSourceUrl: 'https://spacestation13.github.io/dm-playground-linux/',
};
2 changes: 1 addition & 1 deletion src/utils/literalConstants.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const isoUrlSearchParameter = 'isoUrl';
export const vmRemoteUrlSearchParameter = 'vmRemoteUrl';
4 changes: 2 additions & 2 deletions src/vm/emulator.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { EventEmitter, Injectable, Output } from '@angular/core';
import type { WorkerMsgWithoutCID, WorkerResponseMsg } from './emulator.worker';
import { environment } from '../environments/environment';
import { isoUrlSearchParameter } from '../utils/literalConstants';
import { vmRemoteUrlSearchParameter } from '../utils/literalConstants';

const encoder = new TextEncoder();

Expand All @@ -27,7 +27,7 @@ export class EmulatorService {
new (url: URL): Worker;
}
const Worker = function (url: URL) {
url.searchParams.set(isoUrlSearchParameter, environment.isoUrl);
url.searchParams.set(vmRemoteUrlSearchParameter, environment.vmSourceUrl);
return new window.Worker(url);
} as unknown as FakeWorker;
this.worker = new Worker(new URL('./emulator.worker', import.meta.url));
Expand Down
16 changes: 9 additions & 7 deletions src/vm/emulator.worker.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/// <reference lib="webworker" />

import { isoUrlSearchParameter } from '../utils/literalConstants';
import { vmRemoteUrlSearchParameter } from '../utils/literalConstants';

importScripts('./lib/libv86.js');

Expand Down Expand Up @@ -130,17 +129,20 @@ const emulator = new V86({
vga_bios: {
url: 'https://raw.githubusercontent.com/copy/v86/master/bios/vgabios.bin',
},
cdrom: {
url: parameters.get(isoUrlSearchParameter),
},
cdrom: null,
hda: null,
hdb: null,
fda: null,
fdb: null,
initial_state: null,
multiboot: null,
bzimage: null,
initrd: null,
bzimage: {
url: parameters.get(vmRemoteUrlSearchParameter) + 'bzImage',
},
initrd: {
url: parameters.get(vmRemoteUrlSearchParameter) + 'rootfs.cpio.lz4',
async: true,
},
//9p filesystem, { basefs: string, baseurl: string } or {}
filesystem: {},
//Loads bzimage and initrd from 9p filesystem
Expand Down

0 comments on commit a41b280

Please sign in to comment.