'분류 전체보기'에 해당되는 글 71건
- 2008.04.23 캡스톤 디자인 최종문서
- 2008.04.22 중간고사 시험 예상문제~!
- 2008.04.18 R20에 우분투 설치방법
- 2008.04.18 우분투에서 DHCP, STATIC IP 설정 1
- 2008.04.17 4월 17일
- 2008.04.15 4월 15일 수업
- 2008.04.10 4월10일 타겟보드에 리눅스 커널 셋팅
- 2008.04.08 4월 8일 수업 자료
- 2008.04.07 opencv 이미지 필터
- 2008.03.25 riff란
중간고사 시험 예상문제~!
cbnu 4th/Linux 2008. 4. 22. 10:11 |wc -1, w, c
->라인 단어 문자 갯수 세기
ps -f, -ef
->프로세스 확인
PID: 프로세스의 고유한 아이디
쉘: 명령어의 집합
cat > 111한 다음에 ctrl+z하면 명령 프롬프트가 전면으로 나오지만 백그라운드에서는
cat이 동작하고 있다. fg명령어를 치면 cat이 리쥼이 가능하다. 여러가지가 있을 경우
[fg 숫자]의 형태로 입력하면 선택하여 리쥼할 수 있다.
예)fg 1
절대경로, 상대경로
l //path를 입력해 줘야 한다
lp //path가 있다
v //
vp //
l과 v의 차이~!
execlp("ls", "ls", "-l", (char* 0) //중요.....앞에는 각 인자값 그리고 맨 마지막에는 NULL이들어가야 한다...잊어먹기 쉬우므로 잊지말자~명령어에 p가 붙어있으므로 path가 있는 것이다
fork와 exec의 차이점......
시험에 이게 나온다......................................................
마운트 사용방법
리눅스 명령어
stat구조체 공부
gcc가 컴파일되는 과정(생성되는 코드들이랑 단계적으로 하는 일)
절대경로와 상대경로 (바나나~)
라인시크 어떤 옵션을 사용해서
gdb사용방법 (gdb를 사용하려면 컴파일시 옵션을 줘야한다)
chmod chown 사용방법
access 함수와 umask 함수 사용방법 (umask계산방법)
리다이렉션 >와 >>의 특징
하드링크와 소프트링크
open read 함수
a.text라는 파일이 있을 때 이것을 오픈하는 방법을 쓰시오
open("a.txt", 옵션(O_RWD | O_ERW |); 읽기쓰기 전용과 ~~~권한을 가지는 함수를 작성하여라
R20에 우분투 설치방법
Development/Ubuntu Setting 2008. 4. 18. 12:31 |1. 텍스트모드로 설치한다
2. 복구모드로 접속한다
3. 아래 방법을 따라한다
Ubuntu Edgy Installation Guide
From cchtml.com
In Ubuntu Edgy you can choose between two methods of installing the proprietary ATI driver. If you are new to linux you should use the first method as it is a lot easier than the second one and will work well in most cases. The second method describes how to install the very latest driver version, but requires some additional work and knowledge.
Contents[hide] |
[edit] Method 1: Installing Edgy's Included Driver (8.28.8)
The included fglrx driver supports Radeon 8500+ and the X-series cards up to X1900.
[edit] Disable Composite Extension
In Ubuntu Edgy the Composite extension is enabled by default, however, fglrx does not yet support Composite with DRI. In order to to disable Composite you have to edit the xorg.conf file:
sudo gedit /etc/X11/xorg.conf
and add these lines at the end of the file:
File: /etc/X11/xorg.conf |
Section "Extensions" Option "Composite" "Disable" EndSection |
[edit] Installing the driver
Make sure the restricted repository is enabled in /etc/apt/sources.list or this guide will not work!
sudo apt-get update sudo apt-get install linux-restricted-modules-$(uname -r) #Okay if it is already installed sudo apt-get install xorg-driver-fglrx sudo depmod -a sudo aticonfig --initial sudo aticonfig --overlay-type=Xv
Now Reboot your system:
sudo shutdown -r now
An alternative to the aticonfig --initial command is to edit /etc/X11/xorg.conf and replace the string "ati" with "fglrx" in the "Device" section. This way you won't lose your old "Screen" and "Monitor" settings. Afterwards you can use aticonfig for setting overlay etc.
[edit] Confirm that it works
fglrxinfo display: :0.0 screen: 0 OpenGL vendor string: ATI Technologies Inc. OpenGL renderer string: RADEON 9600 Generic OpenGL version string: 2.0.6011 (8.28.8)
[edit] Troubleshooting for Method 1
- The output of dmesg | grep fglrx and /var/log/Xorg.0.log are most useful when looking for errors. You should really include this when you are asking for help somewhere.
- If you used Method 2 before, you have to unblacklist fglrx again by editing /etc/default/linux-restricted-modules-common. You may have to run sudo lrm-manager afterwards.
[edit] Method 2: Generating/Installing Ubuntu packages for the new 8.30.3 drivers in Ubuntu Edgy Manually
The new fglrx driver supports Radeon 9500+ (older cards will not work!) and the X-series cards up to X1900.
[edit] Disable Composite Extension
In Ubuntu Edgy the Composite extension is enabled by default, however, fglrx does not yet support Composite with DRI. In order to to disable Composite you have to edit the xorg.conf file:
sudo gedit /etc/X11/xorg.conf
and add these lines at the end of the file:
File: /etc/X11/xorg.conf |
Section "Extensions" Option "Composite" "Disable" EndSection |
[edit] Blacklist old fglrx module from linux-restricted-modules
As ubuntu's linux-restricted-modules package includes the fglrx module from an old driver version (8.28.8), we have to blacklist this module to make sure the new kernel module which is needed by the new driver will be used instead.
sudo gedit /etc/default/linux-restricted-modules-common
Edit DISABLED_MODULES to include fglrx
File: /etc/default/linux-restricted-modules-common |
DISABLED_MODULES="fglrx" |
[edit] Installing the new driver
Download the ATI driver installer: ati-driver-installer-8.30.3.run (this installer is for 32bit and 64bit systems)
Change to the download directory. Make sure that you have the universe and multiverse repositories enabled in /etc/apt/sources.list before doing these steps.
Install necessary tools:
sudo apt-get update sudo apt-get install module-assistant build-essential sudo apt-get install fakeroot dh-make debconf libstdc++5 linux-headers-$(uname -r)
Create .deb packages:
sudo ln -sf bash /bin/sh bash ati-driver-installer-8.30.3.run --buildpkg Ubuntu/edgy sudo ln -sf dash /bin/sh
Install .deb packages:
sudo dpkg -i xorg-driver-fglrx_8.30.3-1*.deb sudo dpkg -i fglrx-kernel-source_8.30.3-1*.deb sudo dpkg -i fglrx-control_8.30.3-1*.deb
Remove any old fglrx debs from /usr/src/:
sudo rm /usr/src/fglrx-kernel*.deb
Compile the kernel module:
sudo module-assistant prepare sudo module-assistant update sudo module-assistant build fglrx sudo module-assistant install fglrx sudo depmod -a
IMPORTANT: You have to recompile the kernel module after each kernel update!
Update the xorg.conf file:
sudo aticonfig --initial sudo aticonfig --overlay-type=Xv
Note: You could also edit your /usr/X11/xorg.conf file to change your driver to fglrx then run:
sudo aticonfig --overlay-type=Xv
This way your xorg.conf file will stay clean.
Now Reboot:
sudo shutdown -r now
[edit] Confirm that it worked
$ fglrxinfo display: :0.0 screen: 0 OpenGL vendor string: ATI Technologies Inc. OpenGL renderer string: RADEON 9700 Generic OpenGL version string: 2.0.6119 (8.30.3)
$ glxinfo | grep render direct rendering: Yes
If your direct rendering is disabled, you may have to symlink the dri folder:
sudo mkdir /usr/X11R6/lib/modules sudo ln -s /usr/lib/dri /usr/X11R6/lib/modules/
[edit] Troubleshooting for Method 2
[edit] xorg.conf
The aticonfig --initial command will not update the xorg.conf file if it already has a "fglrx" Device section. However, you may force aticonfig to generate default Monitor, Device, and Screen sections with the following command:
sudo aticonfig --force --initial
[edit] The module compiles, but doesn't work
For some reason fglrx may need gcc-4.0 to compile, if you experience some message related to gcc version in dmesg, try this:
First we'll install it
sudo apt-get install gcc-4.0
and link it to gcc.
sudo ln -sf /usr/bin/gcc-4.0 /usr/bin/gcc
After doing the module-assistant steps, you may want to return gcc to 4.1 by default:
sudo ln -sf /usr/bin/gcc-4.1 /usr/bin/gcc
[edit] Troubleshooting for both Methods
[edit] General
The output of dmesg | grep fglrx and /var/log/Xorg.0.log are most useful when looking for errors.
[edit] DRI does not work although the fglrx module is loaded
If fglrxinfo shows:
OpenGL vendor string: Mesa project: www.mesa3d.org
Make sure the Composite extension is disabled, add this to your /etc/X11/xorg.conf file:
Section "Extensions" Option "Composite" "Disable" EndSection
This should also resolve the corrupted mouse cursor problem in dual-head mode.
[edit] Module isn't loaded
If the fglrx module isn't loaded try to add fglrx to /etc/modules on a new line. See also bug 63912.
File: /etc/modules |
# /etc/modules: kernel modules to load at boot time. # # This file contains the names of kernel modules that should be loaded # at boot time, one per line. Lines beginning with "#" are ignored. fglrx |
[edit] 2D speed
If you suffer from slow 2D speed it might help to set
Option "XaaNoOffscreenPixmaps"
in the fglrx device section of /etc/X11/xorg.conf
[edit] Is the rebooting really necessary?
No.
However, rebooting is the easiest method to ensure that the kernel module(s) from the old driver are unloaded and the fglrx module is loaded instead. If you don't want to reboot for some reason, you may manually shut down Xorg, unload any old "drm", "radeon" or "fglrx" modules and then start Xorg again.
Note: if modprobe fglrx can't find the fglrx module, try rebuilding your kernel module dependency:
sudo depmod -a
[edit] Revert to Xorg driver
If (for any reason) the fglrx install fails, you can revert to the Xorg driver by executing
sudo dpkg-reconfigure xserver-xorg
and selecting the "ati" driver, or simply restoring the previous /etc/X11/xorg.conf file, if you made a backup.
You also need to remove the xorg-driver-fglrx or your manually installed drivers to get the 3D acceleration back, since it is provided by file /usr/lib/libGL.so.1.2 which belongs to libgl1-mesa package and which is moved to backup and replaced at the installation of xorg-driver-fglrx (or the manually built) package. In case the removal of the fglrx drivers fails to restore the file from libgl1-mesa, you have to reinstall the package by running:
sudo apt-get install --reinstall libgl1-mesa
우분투에서 DHCP, STATIC IP 설정
Development/Ubuntu Setting 2008. 4. 18. 12:12 |Configuring DHCP address for your network card
If you want to configure DHCP address you need to edit the /etc/network/interfaces and you need to enter the following lines replace eth0 with your network interface card
sudo vi /etc/network/interfaces
# The primary network interface - use DHCP to find our address
auto eth0
iface eth0 inet dhcp
Configuring Static IP address for your network card
If you want to configure Static IP address you need to edit the /etc/network/interfaces and you need to enter the following lines replace eth0 with your network interface card
sudo vi /etc/network/interfaces
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.3.90
gateway 192.168.3.1
netmask 255.255.255.0
network 192.168.3.0
broadcast 192.168.3.255
After entering all the details you need to restart networking services using the following command
sudo /etc/init.d/networking restart
Setting up DNS
When it comes to DNS setup Ubuntu doesn’t differ from other distributions. You can add hostname and IP addresses to the file /etc/hosts for static lookups.
To cause your machine to consult with a particular server for name lookups you simply add their addresses to /etc/resolv.conf.
For example a machine which should perform lookups from the DNS server at IP address 192.168.3.2 would have a resolv.conf file looking like this
sudo vi /etc/resolv.conf
enter the following details
search test.com
nameserver 192.168.3.2
4월 15일 수업
cbnu 4th/Linux 2008. 4. 15. 10:40 |소스파일에 <stdio.h>와 <stdlib.h>를 넣어야 한다
1,2장 개념
하드링크, 소프트링크 비교
함수 사용 방법
OX문제
4,5장에서 코드문제
#include <unistd.h>
#define BUF_SIZE 256
void printcwd()
{
char buffer[BUF_SIZE];
if(getcwd(buffer, BUF_SIZE) == NULL)
exit(1);
printf("%s\n", buffer);
}
int main()
{
printcwd();
chdir("/usr/include");
printcwd(); //한번 출력한 후
chdir(".."); //상위 디렉토리로 이동후(usr)
printcwd(); //다시 출력
}
=========================================================================================
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <dirent.h>
int main()
{
char buffer[256];
DIR *dirp;
struct dirent *dentry;
getcwd(buffer, 256);
printf("%s\n", buffer);
mkdir("apple", 0755);
mkdir("banana", 0755);
chdir("apple");
getcwd(buffer, 256);
printf("%s\n", buffer);
close(open("test.txt", O_CREAT | O_RDWR, 0644));
chdir("..");
rmdir("apple"); //비워져 있지 않기 때문에 지워지지 않는다
rmdir("banana");
dirp = opendir("apple");
while(dentry = readdir(dirp))
if(dentry->d_ino != 0)
printf("%s\n", dentry->d_name);
rewinddir(dirp); //위에 출력된걸 한번더 한다
while(dentry = readdir(dirp))
if(dentry->d_ino != 0)
printf("%s\n", dentry->d_name);
closedir(dirp);
}