Giter Site home page Giter Site logo

xinyx / haiku Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 332.48 MB

C 49.09% C++ 48.38% Python 0.02% Shell 0.47% Perl 0.04% Makefile 0.44% MATLAB 0.01% Groff 0.44% Objective-C 0.05% Scheme 0.01% HTML 0.23% Assembly 0.43% Awk 0.02% Bison 0.14% Logos 0.01% TeX 0.14% Java 0.08% PHP 0.01% Tcl 0.01% PostScript 0.01%

haiku's Introduction

haiku

分支来自10e57f6

@xinyx

linux_hello module移植

linux_hello是ldd3的hello示例驱动,header-gen分析结果位于

[email protected]:/home/driver/header-gen/linux/results/hello_ldd
port 10220

实现linux兼容层compat

$ cd haiku/src/libs/compat/

$ mkdir linux_hello; cd linux_hello
# 将header-gen生成的hello_ldd.dummy.c拷贝到上目录,重命名为hello_dummy.c
# 用haiku提供的内核函数重写其中的linux的printk函数

$ mkdir compat
# 将header-gen生成的hello_ldd.d中的内容拷贝到上面compat

$ vim compat/linux/types.h
# 13行:删除umode_t的定义(与haiku冲突)

$ vim compat/linux/printk.h
# 18行:修改printk声明,使其兼容hello_dummy.c中的定义

$ vim Jamfile
# 用Jamfile将本兼容层生存静态库,供linux驱动使用

$ cd ..; vim Jamfile
# 修改Jamfile,加进linux_hello

移植linux_hello

$ cd haiku/src/add-ons/kernel/drivers
$ mkdir linux_hello; cd linux_hello
# 将原先的hello文件拷贝到此目录

$ vim linux_hello.c
# 重写/重用驱动代码

$ vim Jamfile
# 设置编译规则,引用我们生成的linux兼容层静态库

$ cd ..; vim Jamfile
# 修改Jamfile,加进linux_hello

修改编译链,加进新驱动

$ vim haiku/build/jam/packages/Haiku
$ vim haiku/build/jam/packages/HaikuBootstrap
$ vim haiku/build/jam/packages/HaikuDevel
# 加进linux_hello

调试关键

用jam target调试单个小目标能有效加快调试速度

haiku's People

Contributors

axeld avatar weinhold avatar stippi avatar korli avatar mmuman avatar jackburton79 avatar mmlr avatar anevilyak avatar pulkomandy avatar jscipione avatar rudolfc avatar kallisti5 avatar phoudoin avatar olta avatar pdziepak avatar m6100 avatar mmadia avatar laplace7 avatar kirilla avatar stpere avatar leavengood avatar aejsmith avatar urnenfeld avatar nielx avatar siarzhuk avatar scottmc avatar yourpalal avatar dlmcpaul avatar aldeck avatar tqh avatar

Watchers

 avatar

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.