Code Monkey home page Code Monkey logo

os-workbench-2022's People

Contributors

jiangyy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

os-workbench-2022's Issues

请问一下我在amgame下make的时候会报这个错误呢,是什么配置错误了吗,下面是报错信息

(base) [boyi@boyi amgame]$ make

Building amgame-image [x86_64-qemu]

Building am-archive [x86_64-qemu]

  • CC src/x86/qemu/ioe.c
    /home/boyi/Code/Systerm/os-workbench-2022/abstract-machine/am/src/x86/qemu/ioe.c: 在函数‘__am_lapic_bootap’中:
    /home/boyi/Code/Systerm/os-workbench-2022/abstract-machine/am/src/x86/qemu/ioe.c:433:6: 错误:array subscript 0 is outside array bounds of ‘uint16_t[0]’ {或称 ‘short unsigned int[]’} [-Werror=array-bounds=]
    433 | wrv[0] = 0;
    | ~~~^~~
    cc1: 附注:source object is likely at address zero
    /home/boyi/Code/Systerm/os-workbench-2022/abstract-machine/am/src/x86/qemu/ioe.c:434:6: 错误:array subscript 0 is outside array bounds of ‘uint16_t[0]’ {或称 ‘short unsigned int[]’} [-Werror=array-bounds=]
    434 | wrv[1] = (uintptr_t)addr >> 4;

boot/main.c: Miscompilation on GCC 12.1.0

Without -fno-strict-aliasing, GCC 12.1.0 generates code to load elf32->e_machine before copy_from_disk(elf32, 4096, 0), causing an x86_64 ELF header to be parsed with load_elf32():

    7d13:	b9 00 fc ff ff       	mov    $0xfffffc00,%ecx
    7d18:	ba 00 04 00 00       	mov    $0x400,%edx
    7d1d:	b8 00 00 01 00       	mov    $0x10000,%eax
[*] 7d22:	66 8b 1d 12 80 00 00 	mov    0x8012,%bx
    7d29:	e8 34 ff ff ff       	call   7c62 <copy_from_disk>
    7d2e:	31 c9                	xor    %ecx,%ecx
    7d30:	ba 00 10 00 00       	mov    $0x1000,%edx
    7d35:	b8 00 80 00 00       	mov    $0x8000,%eax
    7d3a:	e8 23 ff ff ff       	call   7c62 <copy_from_disk>
[*] 7d3f:	66 83 fb 3e          	cmp    $0x3e,%bx

With -fno-strict-aliasing, the compiler gives the following code, and the system correctly boots.

    7d13:	b9 00 fc ff ff       	mov    $0xfffffc00,%ecx
    7d18:	ba 00 04 00 00       	mov    $0x400,%edx
    7d1d:	b8 00 00 01 00       	mov    $0x10000,%eax
    7d22:	e8 3b ff ff ff       	call   7c62 <copy_from_disk>
    7d27:	31 c9                	xor    %ecx,%ecx
    7d29:	ba 00 10 00 00       	mov    $0x1000,%edx
    7d2e:	b8 00 80 00 00       	mov    $0x8000,%eax
    7d33:	e8 2a ff ff ff       	call   7c62 <copy_from_disk>
[*] 7d38:	66 83 3d 12 80 00 00 	cmpw   $0x3e,0x8012

It seems the miscompilation is caused by read_disk's treating its buffer as uint32_t *, and changing that to uint8_t * also solves the problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.