suriyaaOS:用" make all"内核自我失败" kernel.elf" - 我该怎么办?

时间:2015-11-20 16:46:13

标签: c++ c makefile linux-kernel cygwin

嗨Stackoverflowers! :-D

问题

我目前 未能使用make all命令 (对于我自己的虚拟操作系统" 在我的 Windows 10上使用CygWin ,并且不知道原因。我需要知道原因。") -.-

  

我的完整项目来源:https://github.com/SuriyaaKudoIsc/suriyaaosIssue on GitHub

关于操作系统

suriyaaOS 一个基本的类UNIX操作系统,如Linux Ubuntu或Debian。 我在QEMU (for Windows)VMware Workstation Player&上运行了suriyaaOS。我的Windows 10(x64位)上的Oracle VirtualBox

安装

在运行操作系统之前,我必须安装Linux和Linux的内核文件。使用命令 make all 然后在Microsoft命令行上使用 make run 进行suriyaaOS( - >> MS CMD),但它不起作用!

代码

root 文件夹中的

Makefile (需要使用或运行make命令/ link):

SDKDIR=./sdk

help:
    @echo "Makefile for Building Suriyaa Operating System (sOS)."
    @echo "Usage: make [ all | clean | help | build | run] " 
    @echo ""
    @echo

all: 
    @echo "Building (Linux) Kernel"
    make -C ./kernel
    @echo "Building SDK"
    make -C ./sdk
    @echo "Building Userland"
    make -C ./userland


build:
    zip -r devos-$(VERSION).zip ./


run:
    @echo "Running Suriyaa Operating System (sOS)."
    cd ./sdk && sudo bash ./diskimage.sh
    cd ./sdk && ./qemu.sh

clean:
    make -C ./kernel clean
    make -C ./userland clean

root 文件夹中的 Vagrantfile (需要为VirtualBox运行带有Vagrant虚拟机的操作系统!)

内核文件夹中的

Makefile (安装后需要生成kernel.elf / link):

ARCH=x86
KERNEL=kernel.elf
SDKDIR=../sdk
INCDIR= -I ./ -I ./modules -I ./core -I ./arch/$(ARCH)


include ./arch/$(ARCH)/config.make

include ./runtime/Makefile
include ./core/Makefile
include ./modules/Makefile
include ./arch/$(ARCH)/Makefile

FLAG :=$(FLAG) -D__$(ARCH)__
PLATFORMS= `find ./arch/ -type d | sed "s/.*\///" | sort`


all: $(KERNEL)

$(KERNEL): $(OBJS)
    $(LD) $(LDFLAG) -o $@ $^ 
    cp $(KERNEL) $(SDKDIR)/bootdisk/

help:
    @echo "Makefile for Kernel."
    @echo "Please see COPYING for licensing information."
    @echo "Output should be: "$(KERNEL)
    @echo "Usage: make [ all | clean] " 
    @echo "Currently supported platforms:"
    @echo $(PLATFORMS)
    @echo

tosdk:
    cp $(KERNEL) $(SDKDIR)/disk/

install:
    sudo cp $(KERNEL) /boot/

debug:
    $(NM) -n $(KERNEL)


hinfo:
    $(OBJDUMP) -f $(KERNEL)

dasm:
    $(OBJDUMP) -d $(KERNEL) > dasm.txt


run:
    cd $(SDKDIR) && sh ./diskimage.sh
    cd $(SDKDIR) && sh ./qemu.sh

geniso:
    cd $(SDKDIR) && sh ./cdrom.sh

%.o: %.cc
    $(SC) $(FLAG) -c $< -o  $@

%.o: %.S
    $(SC) $(FLAG) -c $< -o  $@

%.o: %.asm
    $(ASM) $(ASMFLAG)  -c $< -o  $@


clean:
    rm -f $(OBJS)  $(KERNEL) dasm.txt

我的 qemu.sh 文件位于sdk文件夹中(需要在QEMU / link上运行操作系统):

#!/bin/bash
qemu -m64 1024 -s -hda ./c.img  -curses -serial /suriyaa/tty  -redir tcp:2323::23

Windows上的错误输出

make all进程结束时 跟随错误输出

ld: unrecognised emulation mode: elf_i386
Supported emulations: i386pep i386pe
Makefile:21: recipe for target 'kernel.elf' failed
make[1]: *** [kernel.elf] Error 1
make[1]: Leaving directory '/cygdrive/c/Users/Suriyaa/Downloads/suriyaaos/kernel'
Makefile:10: recipe for target 'all' failed
make: *** [all] Error 2

make run进程结束时 跟随错误输出

C:\Users\Suriyaa\Downloads\suriyaaos>make run
Running Suriyaa Operating System (sOS).
cd ./sdk && sudo bash ./diskimage.sh

Sudowin service is stopped
cd ./sdk && ./qemu.sh
./qemu.sh: line 2: qemu: command not found
Makefile:23: recipe for target 'run' failed
make: *** [run] Error 127

问题

  

有谁知道问题出在哪里?

1 个答案:

答案 0 :(得分:0)

我找到了它!

问题是我输入了第一个cmd:

cd suriyaaos
vagrant up
vagrant ssh

并在第二个新的cmd:

make all
make run

但我必须这样做(所有命令都在一个终端!XD):

cd suriyaaos

# Starts Vagrant VM
# This will start an ubuntu machine and install build-essential, make, Qemu ...
vagrant up

# SSH into machine
vagrant ssh

# Once SSHed
cd /vagrant

# Build kernel, userland ...
make all

# Run emulation
make emulate