Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 30 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
# Binaries
**/*.elf
**/*.bin
**/*.o
**/*.iso
```
# Build artifacts
zig-cache/
zig-out/
*.o
*.obj
*.bin
*.elf

# Zig ignore
**/zig-cache/
**/zig-out/
**/build/
**/build-*/
**/docgen_tmp/
# Dependencies
zig*/
deps/

# Custom ignore
**/mock_framework.zig
**/*.ramdisk
**/*.img
# Logs and temp files
*.log
*.tmp

# Environment
.env
.env.local
*.env.*

# Editors
.vscode/
.idea/
*.swp
*.swo

# OS
.DS_Store
Thumbs.db
```
13 changes: 11 additions & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,17 @@ const x86_i686 = CrossTarget{
.cpu_model = .{ .explicit = &Target.x86.cpu._i686 },
};

const x86_64 = CrossTarget{
.cpu_arch = .x86_64,
.os_tag = .freestanding,
.cpu_model = .{ .explicit = &Target.x86.cpu.x86_64 },
};

pub fn build(b: *Builder) !void {
const target = b.standardTargetOptions(.{ .whitelist = &[_]CrossTarget{x86_i686}, .default_target = x86_i686 });
const target = b.standardTargetOptions(.{ .whitelist = &[_]CrossTarget{ x86_i686, x86_64 }, .default_target = x86_i686 });
const arch = switch (target.getCpuArch()) {
.i386 => "x86",
.x86_64 => "x86_64",
else => unreachable,
};

Expand Down Expand Up @@ -70,6 +77,7 @@ pub fn build(b: *Builder) !void {

const make_iso = switch (target.getCpuArch()) {
.i386 => b.addSystemCommand(&[_][]const u8{ "./makeiso.sh", boot_path, modules_path, iso_dir_path, exec_output_path, ramdisk_path, output_iso }),
.x86_64 => b.addSystemCommand(&[_][]const u8{ "./makeiso.sh", boot_path, modules_path, iso_dir_path, exec_output_path, ramdisk_path, output_iso }),
else => unreachable,
};
make_iso.step.dependOn(&exec.step);
Expand Down Expand Up @@ -138,12 +146,13 @@ pub fn build(b: *Builder) !void {

switch (target.getCpuArch()) {
.i386 => try qemu_args_al.append("qemu-system-i386"),
.x86_64 => try qemu_args_al.append("qemu-system-x86_64"),
else => unreachable,
}
try qemu_args_al.append("-serial");
try qemu_args_al.append("stdio");
switch (target.getCpuArch()) {
.i386 => {
.i386, .x86_64 => {
try qemu_args_al.append("-boot");
try qemu_args_al.append("d");
try qemu_args_al.append("-cdrom");
Expand Down
Loading