Giter Club home page Giter Club logo

linux-0.12's Introduction

linux-0.12's People

Contributors

sky-big 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  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

linux-0.12's Issues

編譯完成如何取代原本環境

編譯完成 產生的Kernel_Image如何放入tool/linux-0.12-080324.zip 取代原本的核心?

我直接把Kernel_Image 重新命名為bootimage-0.12-hd取代原本的bootimage-0.12-hd無法正常運作

关于内联汇编是否需要保护寄存器?

你好,我最近在自学内核代码,我看到你的代码中对一些内联函数进行了寄存器的保护,例如对memory.c中copy_page(from, to)的操作,但是在我的测试情况下

#include <stdio.h>

#define copy_page(from,to)              \
    __asm__(                            \
        "cld ; rep ; movsl"             \
        :                               \
        :"S" (from),"D" (to),"c" (1024) \
        :                               \
        )

int main(){

    copy_page(100, 200);
    return 0;
}

汇编出来的代码为

main:
.LFB0:
	.cfi_startproc
	pushl	%ebp
	.cfi_def_cfa_offset 8
	.cfi_offset 5, -8
	movl	%esp, %ebp
	.cfi_def_cfa_register 5
	pushl	%edi
	pushl	%esi
	.cfi_offset 7, -12
	.cfi_offset 6, -16
	call	__x86.get_pc_thunk.ax
	addl	$_GLOBAL_OFFSET_TABLE_, %eax
	movl	$100, %eax
	movl	$200, %edx
	movl	$1024, %ecx
	movl	%eax, %esi
	movl	%edx, %edi
#APP
# 13 "asm_in_c.c" 1
	cld ; rep ; movsl
# 0 "" 2
#NO_APP
	movl	$0, %eax
	popl	%esi
	.cfi_restore 6
	popl	%edi
	.cfi_restore 7
	popl	%ebp
	.cfi_restore 5
	.cfi_def_cfa 4, 4
	ret
	.cfi_endproc

可以看到编译器好像自动保护了寄存器。

请问,当时是出于什么考虑加上了寄存器保护,或者还是受到gcc版本影响(我的gcc版本为7),是否有必要加入寄存器保护?

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.