mirror of
				https://github.com/taigrr/gopher-os
				synced 2025-01-18 04:43:13 -08:00 
			
		
		
		
	Merge pull request #48 from achilleasa/vbox-make-target
Add Makefile target for running gopher-os ISO using vbox
This commit is contained in:
		
						commit
						c778693de0
					
				
							
								
								
									
										12
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								Makefile
									
									
									
									
									
								
							@ -2,6 +2,7 @@ OS = $(shell uname -s)
 | 
				
			|||||||
ARCH := x86_64
 | 
					ARCH := x86_64
 | 
				
			||||||
BUILD_DIR := build
 | 
					BUILD_DIR := build
 | 
				
			||||||
BUILD_ABS_DIR := $(CURDIR)/$(BUILD_DIR)
 | 
					BUILD_ABS_DIR := $(CURDIR)/$(BUILD_DIR)
 | 
				
			||||||
 | 
					VBOX_VM_NAME := gopher-os
 | 
				
			||||||
 | 
					
 | 
				
			||||||
kernel_target :=$(BUILD_DIR)/kernel-$(ARCH).bin
 | 
					kernel_target :=$(BUILD_DIR)/kernel-$(ARCH).bin
 | 
				
			||||||
iso_target := $(BUILD_DIR)/kernel-$(ARCH).iso
 | 
					iso_target := $(BUILD_DIR)/kernel-$(ARCH).iso
 | 
				
			||||||
@ -129,10 +130,17 @@ iso:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
run: GC_FLAGS += -B
 | 
					run-qemu: GC_FLAGS += -B
 | 
				
			||||||
run: iso
 | 
					run-qemu: iso
 | 
				
			||||||
	qemu-system-$(ARCH) -cdrom $(iso_target) -vga std -d int,cpu_reset -no-reboot
 | 
						qemu-system-$(ARCH) -cdrom $(iso_target) -vga std -d int,cpu_reset -no-reboot
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					run-vbox: iso
 | 
				
			||||||
 | 
						VBoxManage createvm --name $(VBOX_VM_NAME) --ostype "Linux_64" --register || true
 | 
				
			||||||
 | 
						VBoxManage storagectl $(VBOX_VM_NAME) --name "IDE Controller" --add ide || true
 | 
				
			||||||
 | 
						VBoxManage storageattach $(VBOX_VM_NAME) --storagectl "IDE Controller" --port 0 --device 0 --type dvddrive \
 | 
				
			||||||
 | 
							--medium $(iso_target) || true
 | 
				
			||||||
 | 
						VBoxManage startvm $(VBOX_VM_NAME)
 | 
				
			||||||
 | 
						
 | 
				
			||||||
# When building gdb target disable optimizations (-N) and inlining (l) of Go code
 | 
					# When building gdb target disable optimizations (-N) and inlining (l) of Go code
 | 
				
			||||||
gdb: GC_FLAGS += -N -l
 | 
					gdb: GC_FLAGS += -N -l
 | 
				
			||||||
gdb: iso
 | 
					gdb: iso
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user