在DM6446平台,我們在GPP端一般使用MontaVista作業系統來進行程式控制。MontaVista作為一種嵌入式的Linux,和桌面Linux類似,同樣使用視頻驅動V4L2(Video For Linux Two)來進行視頻採集、輸出。本文就V4L2的使用方式做簡易說明。一般的,視頻採集都有如下流程:在V4L2中,視頻裝置被看做一個檔案。使用open函數開啟這個裝置:// 用非阻塞模式開啟網路攝影機裝置int cameraFd;cameraFd = open("/dev/video0",
此版本為測試版,還有些細節問題需要改善,不過已經可以正常遊戲,沒有明顯的bug/**************************************************************************** * snake.c * * Author:SamBrown * * * Implements the game of Snake. ******************************************************************
/* This file is WuZiGame source codehttp://www.baidu.com application launcher, compatible with GNU/Linux and most other POSIX systems Copyright (C) 2013-2014 Sam Brown This software is provided 'as-is', without any express or implied warranty.
【實驗環境】Fedora,核心2.6.21.6【實驗步驟】1. cd /usr/src/linux2. vi kernel/sys.c在最後添加如下代碼:asmlinkage long sys_processinfo(void){ int num=0; unsigned long state; struct task_struct *p; for_each_process(p) {
有了系統調用的經驗,添加模組還是很順利的。 【實驗環境】Fedora,核心2.6.21.6【實驗步驟】1. cd /root/homework/module2. vi process.c3. 加入如下代碼:#include <linux/kernel.h>#include <linux/init.h>#include <linux/module.h>static int process_init(void){ int num=0; struct task_