Setting CPU Affinity

Posted by Jinho on 2009/12/21 14:32
Filed under Computer
Tags : , ,
특정 Process를 원하는 core에서만 실행하고자 할 때가 있다. 이 경우 아래 명령어를 사용해 준다.

Linux

$ taskset -c 0 ./a.out
a.out을 0번 core에서만 실행을 함


Solaris 10

$ psrset -c 3
$ psrset -e 1 ./a.out

첫번째 명령어로 processor set을 설정해준다.
처음 설정해 주면 3번 코어가 1번째 processor set으로 설정이된다.
이후에 그 다음 명령어를 사용해서 첫번째 processor set으로 설정된 3번 코어를 이용해서 프로그램을 실행한다.
2009/12/21 14:32 2009/12/21 14:32

[Linux] Disk Driver 추가하기

Posted by Jinho on 2008/11/12 00:54
Filed under Computer/Linux
Tags : , , ,

[root]# fdisk /dev/hdb
Command (m for help): m (Enter the letter "m" to get list of commands)
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Command (m for help): n
Command action
e extended
p primary partition (1-4)
e
Partition number (1-4): 1
First cylinder (1-2654, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-2654, default 2654):
Using default value 2654

Command (m for help): p

Disk /dev/hdb: 240 heads, 63 sectors, 2654 cylinders
Units = cylinders of 15120 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 1 2654 20064208+ 5 Extended

Command (m for help): w (Write and save partition table)

[root]# mkfs -t ext3 /dev/hdb1
mke2fs 1.27 (8-Mar-2002)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
2508352 inodes, 5016052 blocks
250802 blocks (5.00%) reserved for the super user
First data block=0
154 block groups
32768 blocks per group, 32768 fragments per group
16288 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000

Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root]# mkdir /opt2
[root]# mount -t ext3 /dev/hdb1 /opt2





출처 : http://www.yolinux.com/TUTORIALS/LinuxTutorialAdditionalHardDrive.html




2008/11/12 00:54 2008/11/12 00:54

Sysenter Based System Call Mechanism in Linux 2.6

Posted by Jinho on 2007/07/16 13:52
Filed under Computer/Linux
Tags : ,

Starting with version 2.5, linux kernel introduced a new system call entry mechanism on Pentium II+ processors. Due to performance issues on Pentium IV processors with existing software interrupt method, an alternative system call entry mechanism was implemented using SYSENTER/SYSEXIT instructions available on Pentium II+ processors. This article explores this new mechanism. Discussion is limited to x86 architecture and all source code listings are based on linux kernel 2.6.15.6.

1. What are system calls?

System calls provide userland processes a way to request services from the kernel. What kind of services? Services which are managed by operating system like storage, memory, network, process management etc. For example if a user process wants to read a file, it will have to make 'open' and 'read' system calls. Generally system calls are not called by processes directly. C library provides an interface to all system calls.

2. What happens in a system call?

A kernel code snippet is run on request of a user process. This code runs in ring 0 (with current privilege level -CPL- 0), which is the highest level of privilege in x86 architecture. All user processes run in ring 3 (CPL 3). So, to implement system call mechanism, what we need is 1) a way to call ring 0 code from ring 3 and 2) some kernel code to service the request.

3. Good old way of doing it

Until some time back, linux used to implement system calls on all x86 platforms using software interrupts. To execute a system call, user process will copy desired system call number to %eax and will execute 'int 0x80'. This will generate interrupt 0x80 and an interrupt service routine will be called. For interrupt 0x80, this routine is an "all system calls handling" routine. This routine will execute in ring 0. This routine, as defined in the file /usr/src/linux/arch/i386/kernel/entry.S, will save the current state and call appropriate system call handler based on the value in %eax.

4. New shiny way of doing it

It was found out that this software interrupt method was much slower on Pentium IV processors. To solve this issue, Linus implemented an alternative system call mechanism to take advantage of SYSENTER/SYSEXIT instructions provided by all Pentium II+ processors. Before going further with this new way of doing it, let's make ourselves more familiar with these instructions.

4.1. SYSENTER/SYSEXIT instructions:

Let's look at the authorized source, Intel manual itself. Intel manual says:

The SYSENTER instruction is part of the "Fast System Call" facility introduced on the Pentium® II processor. The SYSENTER instruction is optimized to provide the maximum performance for transitions to protection ring 0 (CPL = 0). The SYSENTER instruction sets the following registers according to values specified by the operating system in certain model-specific registers.

  • CS register set to the value of (SYSENTER_CS_MSR)
  • EIP register set to the value of (SYSENTER_EIP_MSR)
  • SS register set to the sum of (8 plus the value in SYSENTER_CS_MSR)
  • ESP register set to the value of (SYSENTER_ESP_MSR)

Looks like processor is trying to help us. Let's look at SYSEXIT also very quickly:

The SYSEXIT instruction is part of the "Fast System Call" facility introduced on the Pentium® II processor. The SYSEXIT instruction is optimized to provide the maximum performance for transitions to protection ring 3 (CPL = 3) from protection ring 0 (CPL = 0). The SYSEXIT instruction sets the following registers according to values specified by the operating system in certain model-specific or general purpose registers.

  • CS register set to the sum of (16 plus the value in SYSENTER_CS_MSR)
  • EIP register set to the value contained in the EDX register
  • SS register set to the sum of (24 plus the value in SYSENTER_CS_MSR)
  • ESP register set to the value contained in the ECX register

SYSENTER_CS_MSR, SYSENTER_ESP_MSR, and SYSENTER_EIP_MSR are not really names of the registers. Intel just defines the address of these registers as:

SYSENTER_CS_MSR   174h
SYSENTER_ESP_MSR 175h
SYSENTER_EIP_MSR  176h

In linux these registers are named as:

/usr/src/linux/include/asm/msr.h:
101 #define MSR_IA32_SYSENTER_CS 0x174
102 #define MSR_IA32_SYSENTER_ESP 0x175
103 #define MSR_IA32_SYSENTER_EIP 0x176
 

4.2. How does linux 2.6 uses these instructions?

  1. Linux sets up these registers during initialization itself.
    /usr/src/linux/arch/i386/kernel/sysenter.c:
    36 wrmsr(MSR_IA32_SYSENTER_CS, __KERNEL_CS, 0);
    37 wrmsr(MSR_IA32_SYSENTER_ESP, tss->esp1, 0);
    38 wrmsr(MSR_IA32_SYSENTER_EIP, (unsigned long) sysenter_entry, 0);

    Please note that 'tss' refers to the Task State Segment (TSS) and tss->esp1 thus points to the kernel mode stack. [4] explains the use of TSS in linux as:

    The x86 architecture includes a specific segment type called the Task State Segment (TSS), to store hardware contexts. Although Linux doesn't use hardware context switches, it is nonetheless forced to set up a TSS for each distinct CPU in the system. This is done for two main reasons:

    - When an 80 x 86 CPU switches from User Mode to Kernel Mode, it fetches the address of the Kernel Mode stack from the TSS.

    - When a User Mode process attempts to access an I/O port by means of an in or out instruction, the CPU may need to access an I/O Permission Bitmap stored in the TSS to verify whether the process is allowed to address the port.

    So during initialization kernel sets up these registers such that after SYSENTER instruction, ESP is set to kernel mode stack and EIP is set to sysenter_entry.

  2. Kernel also setups system call entry/exit points for user processes. Kernel creates a single page in the memory and attaches it to all processes' address space when they are loaded into memory. This page contains the actual implementation of the system call entry/exit mechanism. Definition of this page can be found in the file /usr/src/linux/arch/i386/kernel/vsyscall-sysenter.S. Kernel calls this page virtual dynamic shared object (vdso). Existence of this page can be confirmed by looking at cat /proc/`pid`/maps:
    slax ~ # cat /proc/self/maps
    08048000-0804c000 r-xp 00000000 07:00 13 /bin/cat
    0804c000-0804d000 rwxp 00003000 07:00 13 /bin/cat
    0804d000-0806e000 rwxp 0804d000 00:00 0 [heap]
    b7ea0000-b7ea1000 rwxp b7ea0000 00:00 0
    b7ea1000-b7fca000 r-xp 00000000 07:03 1840 /lib/tls/libc-2.3.6.so
    b7fca000-b7fcb000 r-xp 00128000 07:03 1840 /lib/tls/libc-2.3.6.so
    b7fcb000-b7fce000 rwxp 00129000 07:03 1840 /lib/tls/libc-2.3.6.so
    b7fce000-b7fd1000 rwxp b7fce000 00:00 0
    b7fe7000-b7ffd000 r-xp 00000000 07:03 1730 /lib/ld-2.3.6.so
    b7ffd000-b7fff000 rwxp 00015000 07:03 1730 /lib/ld-2.3.6.so
    bffe7000-bfffd000 rwxp bffe7000 00:00 0 [stack]
    ffffe000-fffff000 ---p 00000000 00:00 0 [vdso]

    For binaries using shared libraries, this page can be seen using ldd also:

    slax ~ # ldd /bin/ls
    linux-gate.so.1 => (0xffffe000)
    librt.so.1 => /lib/tls/librt.so.1 (0xb7f5f000)
    ...

    Observe linux-gate.so.1. This is no physical file. Content of this vdso can be seen as follows:

    ==> dd if=/proc/self/mem of=linux-gate.dso bs=4096 skip=1048574 count=1
    1+0 records in
    1+0 records out

    ==> objdump -d --start-address=0xffffe400 --stop-address=0xffffe414 linux-gate.dso
    ffffe400 <__kernel_vsyscall>:
    ffffe400: 51 push %ecx
    ffffe401: 52 push %edx
    ffffe402: 55 push %ebp
    ffffe403: 89 e5 mov %esp,%ebp
    ffffe405: 0f 34 sysenter
    ...
    ffffe40d: 90 nop
    ffffe40e: eb f3 jmp ffffe403 <__kernel_vsyscall+0x3>
    ffffe410: 5d pop %ebp
    ffffe411: 5a pop %edx
    ffffe412: 59 pop %ecx
    ffffe413: c3 ret

    In all listings, ... stands for omitted irrelevant code.

  3. Initiation: Userland processes (or C library on their behalf) call __kernel_vsyscall to execute system calls. Address of __kernel_vsyscall is not fixed. Kernel passes this address to userland processes using AT_SYSINFO elf parameter. AT_ elf parameters, a.k.a. elf auxiliary vectors, are loaded on the process stack at the time of startup, alongwith the process arguments and the environment variables. Look at [1] for more information on Elf auxiliary vectors.

    After moving to this address, registers %ecx, %edx and %ebp are saved on the user stack and %esp is copied to %ebp before executing sysenter. This %ebp later helps kernel in restoring userland stack back. After executing sysenter instruction, processor starts execution at sysenter_entry. sysenter_entry is defined in /usr/src/linux/arch/i386/kernel/entry.S as: (See my comments in [ ])

          179 ENTRY(sysenter_entry)
    180 movl TSS_sysenter_esp0(%esp),%esp
    181 sysenter_past_esp:
    182 sti
    183 pushl $(__USER_DS)
    184 pushl %ebp [%ebp contains userland %esp]
    185 pushfl
    186 pushl $(__USER_CS)
    187 pushl $SYSENTER_RETURN [%userland return addr]
    188
    ....
    201 pushl %eax
    202 SAVE_ALL [pushes registers on to stack]
    203 GET_THREAD_INFO(%ebp)
    204
    205 /* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */
    206 testw $(_TIF_SYSCALL_EMU|_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT),
    TI_flags(%ebp)
    207 jnz syscall_trace_entry
    208 cmpl $(nr_syscalls), %eax
    209 jae syscall_badsys
    210 call *sys_call_table(,%eax,4)
    211 movl %eax,EAX(%esp)
    ......
  4. Inside sysenter_entry: between line 183 and 202, kernel is saving the current state by pushing register values on to the stack.

    Observe that $SYSENTER_RETURN is the userland return address as defined inside /usr/src/linux/arch/i386/kernel/vsyscall-sysenter.S and %ebp contains userland ESP as %esp was copied to %ebp before calling sysenter.

  5. After saving the state, kernel validates the system call number stored in %eax. Finally appropriate system call is called using instruction:

    210 call *sys_call_table(,%eax,4)

    This is very much similar to old way.

  6. After system call is complete, processor resumes execution at line 211. Looking further in sysenter_entry definition:
        210         call *sys_call_table(,%eax,4)
    211 movl %eax,EAX(%esp)
    212 cli
    213 movl TI_flags(%ebp), %ecx
    214 testw $_TIF_ALLWORK_MASK, %cx
    215 jne syscall_exit_work
    216 /* if something modifies registers it must also disable sysexit */
    217 movl EIP(%esp), %edx (EIP is 0x28)
    218 movl OLDESP(%esp), %ecx (OLD ESP is 0x34)
    219 xorl %ebp,%ebp
    220 sti
    221 sysexit
  7. Copies value in %eax to stack. Userland ESP and return address (to-be EIP) are copied from kernel stack to %edx and %ecx respectively. Observe that the userland return address, $SYSENTER_RETURN was pushed on to stack in line 187. After that 0x28 bytes have been pushed on to the stack. That's why 0x28(%esp) points to $SYSENTER_RETURN.
  8. After that SYSEXIT instruction is executed. As we know from previous section, sysexit copies value in %edx to EIP and value in %ecx to ESP. sysexit transfers processor back to ring 3 and processor resumes execution in userland.

5. Some Code

#include <stdio.h>

int pid;

int main() {
__asm__(
"movl $20, %eax \n"
"call *%gs:0x10 \n" /* offset 0x10 is not fixed across the systems */
"movl %eax, pid \n"
);
printf("pid is %d\n", pid);
return 0;
}

This does the getpid() system call (__NR_getpid is 20) using __kernel_vsyscall instead of int 0x80. Why %gs:0x10? Parsing process stack to find out AT_SYSINFO's value can be a cumbersome task. So, when libc.so (C library) is loaded, it copies the value of AT_SYSINFO from the process stack to the TCB (Thread Control Block). Segment register %gs refers to the TCB.

Please note that the offset 0x10 is not fixed across the systems. I found it out for my system using GDB. A system independent way to find out AT_SYSINFO is given in [1].

Note: This example is taken from http://www.win.tue.nl/~aeb/linux/lk/lk-4.html after little modification to make it work on my system.

6. References

Here are some references that helped me understand this.

  1. About Elf auxiliary vectors By Manu Garg
  2. What is linux-gate.so.1? By Johan Peterson
  3. This Linux kernel: System Calls By Andries Brouwer
  4. Understanding the Linux Kernel, By Daniel P. Bovet, Marco Cesati
  5. Linux Kernel source code  
2007/07/16 13:52 2007/07/16 13:52

VMWare에서 해상도가 맞지 않을때..

Posted by Jinho on 2007/05/21 11:21
Filed under Computer/Linux
Tags : ,
/etc/X11/xorg.conf를 아래 내용으로 바꿔준다.
# Xorg configuration 
 
Section "ServerLayout"
Identifier "Default Layout"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
 
Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection
 
Section "Device"
Identifier "VMware SVGA"
Driver "vmware"
EndSection
 
 
Section "Monitor"
Identifier "vmware"
VendorName "VMware, Inc"
HorizSync 1-10000
VertRefresh 1-10000
 
ModeLine "640x480" 100 640 700 800 900 480 500 600 700
ModeLine "1280x480" 100 1280 1300 1400 1500 480 500 600 700
ModeLine "640x960" 100 640 700 800 900 960 1000 1100 1200
ModeLine "800x600" 100 800 900 1000 1100 600 700 800 900
ModeLine "1600x600" 100 1600 1700 1800 1900 600 700 800 900
ModeLine "800x1200" 100 800 900 1000 1100 1200 1300 1400 1500
ModeLine "1024x768" 100 1024 1100 1200 1300 768 800 900 1000
ModeLine "2048x768" 100 2048 2100 2200 2300 768 800 900 1000
ModeLine "1024x1536" 100 1024 1100 1200 1300 1536 1600 1700 1800
ModeLine "1152x864" 100 1152 1200 1300 1400 864 900 1000 1100
ModeLine "2304x864" 100 2304 2400 2500 2600 864 900 1000 1100
ModeLine "1152x1728" 100 1152 1200 1300 1400 1728 1800 1900 2000
ModeLine "1280x1024" 100 1280 1300 1400 1500 1024 1100 1200 1300
ModeLine "2560x1024" 100 2560 2600 2700 2800 1024 1100 1200 1300
ModeLine "1280x2048" 100 1280 1300 1400 1500 2048 2100 2200 2300
ModeLine "1600x1200" 100 1600 1700 1800 1900 1200 1300 1400 1500
ModeLine "3200x1200" 100 3200 3300 3400 3500 1200 1300 1400 1500
ModeLine "1600x2400" 100 1600 1700 1800 1900 2400 2500 2600 2700
ModeLine "1920x1400" 100 1920 2000 2100 2200 1200 1300 1400 1500
ModeLine "3940x1400" 100 1920 2000 2100 2200 1200 1300 1400 1500
ModeLine "1920x2800" 100 1920 2000 2100 2200 1200 1300 1400 1500
ModeLine "1152x900" 100 1152 1200 1300 1400 900 1000 1100 1200
ModeLine "1280x800" 100 1280 1300 1400 1500 800 900 1000 1100
ModeLine "1376x1032" 100 1376 1400 1500 1600 1032 1100 1200 1300
ModeLine "1400x1050" 100 1400 1500 1600 1700 1050 1100 1200 1300
ModeLine "1680x1050" 100 1680 1700 1800 1900 1050 1100 1200 1300
ModeLine "1920x1200" 100 1920 2000 2100 2200 1200 1300 1400 1500
ModeLine "2364x1773" 100 2364 2400 2500 2600 1773 1800 1900 2000
ModeLine "100x100" 100 100 200 300 400 100 200 300 400
ModeLine "100x200" 100 100 200 300 400 200 300 400 500
ModeLine "100x300" 100 100 200 300 400 300 400 500 600
ModeLine "100x400" 100 100 200 300 400 400 500 600 700
ModeLine "100x500" 100 100 200 300 400 500 600 700 800
ModeLine "100x600" 100 100 200 300 400 600 700 800 900
ModeLine "100x700" 100 100 200 300 400 700 800 900 1000
ModeLine "100x800" 100 100 200 300 400 800 900 1000 1100
ModeLine "100x900" 100 100 200 300 400 900 1000 1100 1200
ModeLine "100x1000" 100 100 200 300 400 1000 1100 1200 1300
ModeLine "100x1100" 100 100 200 300 400 1100 1200 1300 1400
ModeLine "100x1200" 100 100 200 300 400 1200 1300 1400 1500
ModeLine "100x1300" 100 100 200 300 400 1300 1400 1500 1600
ModeLine "100x1400" 100 100 200 300 400 1400 1500 1600 1700
ModeLine "100x1500" 100 100 200 300 400 1500 1600 1700 1800
ModeLine "100x1600" 100 100 200 300 400 1600 1700 1800 1900
ModeLine "100x1700" 100 100 200 300 400 1700 1800 1900 2000
ModeLine "100x1800" 100 100 200 300 400 1800 1900 2000 2100
ModeLine "100x1900" 100 100 200 300 400 1900 2000 2100 2200
ModeLine "100x2000" 100 100 200 300 400 2000 2100 2200 2300
ModeLine "200x100" 100 200 300 400 500 100 200 300 400
ModeLine "200x200" 100 200 300 400 500 200 300 400 500
ModeLine "200x300" 100 200 300 400 500 300 400 500 600
ModeLine "200x400" 100 200 300 400 500 400 500 600 700
ModeLine "200x500" 100 200 300 400 500 500 600 700 800
ModeLine "200x600" 100 200 300 400 500 600 700 800 900
ModeLine "200x700" 100 200 300 400 500 700 800 900 1000
ModeLine "200x800" 100 200 300 400 500 800 900 1000 1100
ModeLine "200x900" 100 200 300 400 500 900 1000 1100 1200
ModeLine "200x1000" 100 200 300 400 500 1000 1100 1200 1300
ModeLine "200x1100" 100 200 300 400 500 1100 1200 1300 1400
ModeLine "200x1200" 100 200 300 400 500 1200 1300 1400 1500
ModeLine "200x1300" 100 200 300 400 500 1300 1400 1500 1600
ModeLine "200x1400" 100 200 300 400 500 1400 1500 1600 1700
ModeLine "200x1500" 100 200 300 400 500 1500 1600 1700 1800
ModeLine "200x1600" 100 200 300 400 500 1600 1700 1800 1900
ModeLine "200x1700" 100 200 300 400 500 1700 1800 1900 2000
ModeLine "200x1800" 100 200 300 400 500 1800 1900 2000 2100
ModeLine "200x1900" 100 200 300 400 500 1900 2000 2100 2200
ModeLine "200x2000" 100 200 300 400 500 2000 2100 2200 2300
ModeLine "300x100" 100 300 400 500 600 100 200 300 400
ModeLine "300x200" 100 300 400 500 600 200 300 400 500
ModeLine "300x300" 100 300 400 500 600 300 400 500 600
ModeLine "300x400" 100 300 400 500 600 400 500 600 700
ModeLine "300x500" 100 300 400 500 600 500 600 700 800
ModeLine "300x600" 100 300 400 500 600 600 700 800 900
ModeLine "300x700" 100 300 400 500 600 700 800 900 1000
ModeLine "300x800" 100 300 400 500 600 800 900 1000 1100
ModeLine "300x900" 100 300 400 500 600 900 1000 1100 1200
ModeLine "300x1000" 100 300 400 500 600 1000 1100 1200 1300
ModeLine "300x1100" 100 300 400 500 600 1100 1200 1300 1400
ModeLine "300x1200" 100 300 400 500 600 1200 1300 1400 1500
ModeLine "300x1300" 100 300 400 500 600 1300 1400 1500 1600
ModeLine "300x1400" 100 300 400 500 600 1400 1500 1600 1700
ModeLine "300x1500" 100 300 400 500 600 1500 1600 1700 1800
ModeLine "300x1600" 100 300 400 500 600 1600 1700 1800 1900
ModeLine "300x1700" 100 300 400 500 600 1700 1800 1900 2000
ModeLine "300x1800" 100 300 400 500 600 1800 1900 2000 2100
ModeLine "300x1900" 100 300 400 500 600 1900 2000 2100 2200
ModeLine "300x2000" 100 300 400 500 600 2000 2100 2200 2300
ModeLine "400x100" 100 400 500 600 700 100 200 300 400
ModeLine "400x200" 100 400 500 600 700 200 300 400 500
ModeLine "400x300" 100 400 500 600 700 300 400 500 600
ModeLine "400x400" 100 400 500 600 700 400 500 600 700
ModeLine "400x500" 100 400 500 600 700 500 600 700 800
ModeLine "400x600" 100 400 500 600 700 600 700 800 900
ModeLine "400x700" 100 400 500 600 700 700 800 900 1000
ModeLine "400x800" 100 400 500 600 700 800 900 1000 1100
ModeLine "400x900" 100 400 500 600 700 900 1000 1100 1200
ModeLine "400x1000" 100 400 500 600 700 1000 1100 1200 1300
ModeLine "400x1100" 100 400 500 600 700 1100 1200 1300 1400
ModeLine "400x1200" 100 400 500 600 700 1200 1300 1400 1500
ModeLine "400x1300" 100 400 500 600 700 1300 1400 1500 1600
ModeLine "400x1400" 100 400 500 600 700 1400 1500 1600 1700
ModeLine "400x1500" 100 400 500 600 700 1500 1600 1700 1800
ModeLine "400x1600" 100 400 500 600 700 1600 1700 1800 1900
ModeLine "400x1700" 100 400 500 600 700 1700 1800 1900 2000
ModeLine "400x1800" 100 400 500 600 700 1800 1900 2000 2100
ModeLine "400x1900" 100 400 500 600 700 1900 2000 2100 2200
ModeLine "400x2000" 100 400 500 600 700 2000 2100 2200 2300
ModeLine "500x100" 100 500 600 700 800 100 200 300 400
ModeLine "500x200" 100 500 600 700 800 200 300 400 500
ModeLine "500x300" 100 500 600 700 800 300 400 500 600
ModeLine "500x400" 100 500 600 700 800 400 500 600 700
ModeLine "500x500" 100 500 600 700 800 500 600 700 800
ModeLine "500x600" 100 500 600 700 800 600 700 800 900
ModeLine "500x700" 100 500 600 700 800 700 800 900 1000
ModeLine "500x800" 100 500 600 700 800 800 900 1000 1100
ModeLine "500x900" 100 500 600 700 800 900 1000 1100 1200
ModeLine "500x1000" 100 500 600 700 800 1000 1100 1200 1300
ModeLine "500x1100" 100 500 600 700 800 1100 1200 1300 1400
ModeLine "500x1200" 100 500 600 700 800 1200 1300 1400 1500
ModeLine "500x1300" 100 500 600 700 800 1300 1400 1500 1600
ModeLine "500x1400" 100 500 600 700 800 1400 1500 1600 1700
ModeLine "500x1500" 100 500 600 700 800 1500 1600 1700 1800
ModeLine "500x1600" 100 500 600 700 800 1600 1700 1800 1900
ModeLine "500x1700" 100 500 600 700 800 1700 1800 1900 2000
ModeLine "500x1800" 100 500 600 700 800 1800 1900 2000 2100
ModeLine "500x1900" 100 500 600 700 800 1900 2000 2100 2200
ModeLine "500x2000" 100 500 600 700 800 2000 2100 2200 2300
ModeLine "600x100" 100 600 700 800 900 100 200 300 400
ModeLine "600x200" 100 600 700 800 900 200 300 400 500
ModeLine "600x300" 100 600 700 800 900 300 400 500 600
ModeLine "600x400" 100 600 700 800 900 400 500 600 700
ModeLine "600x500" 100 600 700 800 900 500 600 700 800
ModeLine "600x600" 100 600 700 800 900 600 700 800 900
ModeLine "600x700" 100 600 700 800 900 700 800 900 1000
ModeLine "600x800" 100 600 700 800 900 800 900 1000 1100
ModeLine "600x900" 100 600 700 800 900 900 1000 1100 1200
ModeLine "600x1000" 100 600 700 800 900 1000 1100 1200 1300
ModeLine "600x1100" 100 600 700 800 900 1100 1200 1300 1400
ModeLine "600x1200" 100 600 700 800 900 1200 1300 1400 1500
ModeLine "600x1300" 100 600 700 800 900 1300 1400 1500 1600
ModeLine "600x1400" 100 600 700 800 900 1400 1500 1600 1700
ModeLine "600x1500" 100 600 700 800 900 1500 1600 1700 1800
ModeLine "600x1600" 100 600 700 800 900 1600 1700 1800 1900
ModeLine "600x1700" 100 600 700 800 900 1700 1800 1900 2000
ModeLine "600x1800" 100 600 700 800 900 1800 1900 2000 2100
ModeLine "600x1900" 100 600 700 800 900 1900 2000 2100 2200
ModeLine "600x2000" 100 600 700 800 900 2000 2100 2200 2300
ModeLine "700x100" 100 700 800 900 1000 100 200 300 400
ModeLine "700x200" 100 700 800 900 1000 200 300 400 500
ModeLine "700x300" 100 700 800 900 1000 300 400 500 600
ModeLine "700x400" 100 700 800 900 1000 400 500 600 700
ModeLine "700x500" 100 700 800 900 1000 500 600 700 800
ModeLine "700x600" 100 700 800 900 1000 600 700 800 900
ModeLine "700x700" 100 700 800 900 1000 700 800 900 1000
ModeLine "700x800" 100 700 800 900 1000 800 900 1000 1100
ModeLine "700x900" 100 700 800 900 1000 900 1000 1100 1200
ModeLine "700x1000" 100 700 800 900 1000 1000 1100 1200 1300
ModeLine "700x1100" 100 700 800 900 1000 1100 1200 1300 1400
ModeLine "700x1200" 100 700 800 900 1000 1200 1300 1400 1500
ModeLine "700x1300" 100 700 800 900 1000 1300 1400 1500 1600
ModeLine "700x1400" 100 700 800 900 1000 1400 1500 1600 1700
ModeLine "700x1500" 100 700 800 900 1000 1500 1600 1700 1800
ModeLine "700x1600" 100 700 800 900 1000 1600 1700 1800 1900
ModeLine "700x1700" 100 700 800 900 1000 1700 1800 1900 2000
ModeLine "700x1800" 100 700 800 900 1000 1800 1900 2000 2100
ModeLine "700x1900" 100 700 800 900 1000 1900 2000 2100 2200
ModeLine "700x2000" 100 700 800 900 1000 2000 2100 2200 2300
ModeLine "800x100" 100 800 900 1000 1100 100 200 300 400
ModeLine "800x200" 100 800 900 1000 1100 200 300 400 500
ModeLine "800x300" 100 800 900 1000 1100 300 400 500 600
ModeLine "800x400" 100 800 900 1000 1100 400 500 600 700
ModeLine "800x500" 100 800 900 1000 1100 500 600 700 800
ModeLine "800x600" 100 800 900 1000 1100 600 700 800 900
ModeLine "800x700" 100 800 900 1000 1100 700 800 900 1000
ModeLine "800x800" 100 800 900 1000 1100 800 900 1000 1100
ModeLine "800x900" 100 800 900 1000 1100 900 1000 1100 1200
ModeLine "800x1000" 100 800 900 1000 1100 1000 1100 1200 1300
ModeLine "800x1100" 100 800 900 1000 1100 1100 1200 1300 1400
ModeLine "800x1200" 100 800 900 1000 1100 1200 1300 1400 1500
ModeLine "800x1300" 100 800 900 1000 1100 1300 1400 1500 1600
ModeLine "800x1400" 100 800 900 1000 1100 1400 1500 1600 1700
ModeLine "800x1500" 100 800 900 1000 1100 1500 1600 1700 1800
ModeLine "800x1600" 100 800 900 1000 1100 1600 1700 1800 1900
ModeLine "800x1700" 100 800 900 1000 1100 1700 1800 1900 2000
ModeLine "800x1800" 100 800 900 1000 1100 1800 1900 2000 2100
ModeLine "800x1900" 100 800 900 1000 1100 1900 2000 2100 2200
ModeLine "800x2000" 100 800 900 1000 1100 2000 2100 2200 2300
ModeLine "900x100" 100 900 1000 1100 1200 100 200 300 400
ModeLine "900x200" 100 900 1000 1100 1200 200 300 400 500
ModeLine "900x300" 100 900 1000 1100 1200 300 400 500 600
ModeLine "900x400" 100 900 1000 1100 1200 400 500 600 700
ModeLine "900x500" 100 900 1000 1100 1200 500 600 700 800
ModeLine "900x600" 100 900 1000 1100 1200 600 700 800 900
ModeLine "900x700" 100 900 1000 1100 1200 700 800 900 1000
ModeLine "900x800" 100 900 1000 1100 1200 800 900 1000 1100
ModeLine "900x900" 100 900 1000 1100 1200 900 1000 1100 1200
ModeLine "900x1000" 100 900 1000 1100 1200 1000 1100 1200 1300
ModeLine "900x1100" 100 900 1000 1100 1200 1100 1200 1300 1400
ModeLine "900x1200" 100 900 1000 1100 1200 1200 1300 1400 1500
ModeLine "900x1300" 100 900 1000 1100 1200 1300 1400 1500 1600
ModeLine "900x1400" 100 900 1000 1100 1200 1400 1500 1600 1700
ModeLine "900x1500" 100 900 1000 1100 1200 1500 1600 1700 1800
ModeLine "900x1600" 100 900 1000 1100 1200 1600 1700 1800 1900
ModeLine "900x1700" 100 900 1000 1100 1200 1700 1800 1900 2000
ModeLine "900x1800" 100 900 1000 1100 1200 1800 1900 2000 2100
ModeLine "900x1900" 100 900 1000 1100 1200 1900 2000 2100 2200
ModeLine "900x2000" 100 900 1000 1100 1200 2000 2100 2200 2300
ModeLine "1000x100" 100 1000 1100 1200 1300 100 200 300 400
ModeLine "1000x200" 100 1000 1100 1200 1300 200 300 400 500
ModeLine "1000x300" 100 1000 1100 1200 1300 300 400 500 600
ModeLine "1000x400" 100 1000 1100 1200 1300 400 500 600 700
ModeLine "1000x500" 100 1000 1100 1200 1300 500 600 700 800
ModeLine "1000x600" 100 1000 1100 1200 1300 600 700 800 900
ModeLine "1000x700" 100 1000 1100 1200 1300 700 800 900 1000
ModeLine "1000x800" 100 1000 1100 1200 1300 800 900 1000 1100
ModeLine "1000x900" 100 1000 1100 1200 1300 900 1000 1100 1200
ModeLine "1000x1000" 100 1000 1100 1200 1300 1000 1100 1200 1300
ModeLine "1000x1100" 100 1000 1100 1200 1300 1100 1200 1300 1400
ModeLine "1000x1200" 100 1000 1100 1200 1300 1200 1300 1400 1500
ModeLine "1000x1300" 100 1000 1100 1200 1300 1300 1400 1500 1600
ModeLine "1000x1400" 100 1000 1100 1200 1300 1400 1500 1600 1700
ModeLine "1000x1500" 100 1000 1100 1200 1300 1500 1600 1700 1800
ModeLine "1000x1600" 100 1000 1100 1200 1300 1600 1700 1800 1900
ModeLine "1000x1700" 100 1000 1100 1200 1300 1700 1800 1900 2000
ModeLine "1000x1800" 100 1000 1100 1200 1300 1800 1900 2000 2100
ModeLine "1000x1900" 100 1000 1100 1200 1300 1900 2000 2100 2200
ModeLine "1000x2000" 100 1000 1100 1200 1300 2000 2100 2200 2300
ModeLine "1100x100" 100 1100 1200 1300 1400 100 200 300 400
ModeLine "1100x200" 100 1100 1200 1300 1400 200 300 400 500
ModeLine "1100x300" 100 1100 1200 1300 1400 300 400 500 600
ModeLine "1100x400" 100 1100 1200 1300 1400 400 500 600 700
ModeLine "1100x500" 100 1100 1200 1300 1400 500 600 700 800
ModeLine "1100x600" 100 1100 1200 1300 1400 600 700 800 900
ModeLine "1100x700" 100 1100 1200 1300 1400 700 800 900 1000
ModeLine "1100x800" 100 1100 1200 1300 1400 800 900 1000 1100
ModeLine "1100x900" 100 1100 1200 1300 1400 900 1000 1100 1200
ModeLine "1100x1000" 100 1100 1200 1300 1400 1000 1100 1200 1300
ModeLine "1100x1100" 100 1100 1200 1300 1400 1100 1200 1300 1400
ModeLine "1100x1200" 100 1100 1200 1300 1400 1200 1300 1400 1500
ModeLine "1100x1300" 100 1100 1200 1300 1400 1300 1400 1500 1600
ModeLine "1100x1400" 100 1100 1200 1300 1400 1400 1500 1600 1700
ModeLine "1100x1500" 100 1100 1200 1300 1400 1500 1600 1700 1800
ModeLine "1100x1600" 100 1100 1200 1300 1400 1600 1700 1800 1900
ModeLine "1100x1700" 100 1100 1200 1300 1400 1700 1800 1900 2000
ModeLine "1100x1800" 100 1100 1200 1300 1400 1800 1900 2000 2100
ModeLine "1100x1900" 100 1100 1200 1300 1400 1900 2000 2100 2200
ModeLine "1100x2000" 100 1100 1200 1300 1400 2000 2100 2200 2300
ModeLine "1200x100" 100 1200 1300 1400 1500 100 200 300 400
ModeLine "1200x200" 100 1200 1300 1400 1500 200 300 400 500
ModeLine "1200x300" 100 1200 1300 1400 1500 300 400 500 600
ModeLine "1200x400" 100 1200 1300 1400 1500 400 500 600 700
ModeLine "1200x500" 100 1200 1300 1400 1500 500 600 700 800
ModeLine "1200x600" 100 1200 1300 1400 1500 600 700 800 900
ModeLine "1200x700" 100 1200 1300 1400 1500 700 800 900 1000
ModeLine "1200x800" 100 1200 1300 1400 1500 800 900 1000 1100
ModeLine "1200x900" 100 1200 1300 1400 1500 900 1000 1100 1200
ModeLine "1200x1000" 100 1200 1300 1400 1500 1000 1100 1200 1300
ModeLine "1200x1100" 100 1200 1300 1400 1500 1100 1200 1300 1400
ModeLine "1200x1200" 100 1200 1300 1400 1500 1200 1300 1400 1500
ModeLine "1200x1300" 100 1200 1300 1400 1500 1300 1400 1500 1600
ModeLine "1200x1400" 100 1200 1300 1400 1500 1400 1500 1600 1700
ModeLine "1200x1500" 100 1200 1300 1400 1500 1500 1600 1700 1800
ModeLine "1200x1600" 100 1200 1300 1400 1500 1600 1700 1800 1900
ModeLine "1200x1700" 100 1200 1300 1400 1500 1700 1800 1900 2000
ModeLine "1200x1800" 100 1200 1300 1400 1500 1800 1900 2000 2100
ModeLine "1200x1900" 100 1200 1300 1400 1500 1900 2000 2100 2200
ModeLine "1200x2000" 100 1200 1300 1400 1500 2000 2100 2200 2300
ModeLine "1300x100" 100 1300 1400 1500 1600 100 200 300 400
ModeLine "1300x200" 100 1300 1400 1500 1600 200 300 400 500
ModeLine "1300x300" 100 1300 1400 1500 1600 300 400 500 600
ModeLine "1300x400" 100 1300 1400 1500 1600 400 500 600 700
ModeLine "1300x500" 100 1300 1400 1500 1600 500 600 700 800
ModeLine "1300x600" 100 1300 1400 1500 1600 600 700 800 900
ModeLine "1300x700" 100 1300 1400 1500 1600 700 800 900 1000
ModeLine "1300x800" 100 1300 1400 1500 1600 800 900 1000 1100
ModeLine "1300x900" 100 1300 1400 1500 1600 900 1000 1100 1200
ModeLine "1300x1000" 100 1300 1400 1500 1600 1000 1100 1200 1300
ModeLine "1300x1100" 100 1300 1400 1500 1600 1100 1200 1300 1400
ModeLine "1300x1200" 100 1300 1400 1500 1600 1200 1300 1400 1500
ModeLine "1300x1300" 100 1300 1400 1500 1600 1300 1400 1500 1600
ModeLine "1300x1400" 100 1300 1400 1500 1600 1400 1500 1600 1700
ModeLine "1300x1500" 100 1300 1400 1500 1600 1500 1600 1700 1800
ModeLine "1300x1600" 100 1300 1400 1500 1600 1600 1700 1800 1900
ModeLine "1300x1700" 100 1300 1400 1500 1600 1700 1800 1900 2000
ModeLine "1300x1800" 100 1300 1400 1500 1600 1800 1900 2000 2100
ModeLine "1300x1900" 100 1300 1400 1500 1600 1900 2000 2100 2200
ModeLine "1300x2000" 100 1300 1400 1500 1600 2000 2100 2200 2300
ModeLine "1400x100" 100 1400 1500 1600 1700 100 200 300 400
ModeLine "1400x200" 100 1400 1500 1600 1700 200 300 400 500
ModeLine "1400x300" 100 1400 1500 1600 1700 300 400 500 600
ModeLine "1400x400" 100 1400 1500 1600 1700 400 500 600 700
ModeLine "1400x500" 100 1400 1500 1600 1700 500 600 700 800
ModeLine "1400x600" 100 1400 1500 1600 1700 600 700 800 900
ModeLine "1400x700" 100 1400 1500 1600 1700 700 800 900 1000
ModeLine "1400x800" 100 1400 1500 1600 1700 800 900 1000 1100
ModeLine "1400x900" 100 1400 1500 1600 1700 900 1000 1100 1200
ModeLine "1400x1000" 100 1400 1500 1600 1700 1000 1100 1200 1300
ModeLine "1400x1100" 100 1400 1500 1600 1700 1100 1200 1300 1400
ModeLine "1400x1200" 100 1400 1500 1600 1700 1200 1300 1400 1500
ModeLine "1400x1300" 100 1400 1500 1600 1700 1300 1400 1500 1600
ModeLine "1400x1400" 100 1400 1500 1600 1700 1400 1500 1600 1700
ModeLine "1400x1500" 100 1400 1500 1600 1700 1500 1600 1700 1800
ModeLine "1400x1600" 100 1400 1500 1600 1700 1600 1700 1800 1900
ModeLine "1400x1700" 100 1400 1500 1600 1700 1700 1800 1900 2000
ModeLine "1400x1800" 100 1400 1500 1600 1700 1800 1900 2000 2100
ModeLine "1400x1900" 100 1400 1500 1600 1700 1900 2000 2100 2200
ModeLine "1400x2000" 100 1400 1500 1600 1700 2000 2100 2200 2300
ModeLine "1500x100" 100 1500 1600 1700 1800 100 200 300 400
ModeLine "1500x200" 100 1500 1600 1700 1800 200 300 400 500
ModeLine "1500x300" 100 1500 1600 1700 1800 300 400 500 600
ModeLine "1500x400" 100 1500 1600 1700 1800 400 500 600 700
ModeLine "1500x500" 100 1500 1600 1700 1800 500 600 700 800
ModeLine "1500x600" 100 1500 1600 1700 1800 600 700 800 900
ModeLine "1500x700" 100 1500 1600 1700 1800 700 800 900 1000
ModeLine "1500x800" 100 1500 1600 1700 1800 800 900 1000 1100
ModeLine "1500x900" 100 1500 1600 1700 1800 900 1000 1100 1200
ModeLine "1500x1000" 100 1500 1600 1700 1800 1000 1100 1200 1300
ModeLine "1500x1100" 100 1500 1600 1700 1800 1100 1200 1300 1400
ModeLine "1500x1200" 100 1500 1600 1700 1800 1200 1300 1400 1500
ModeLine "1500x1300" 100 1500 1600 1700 1800 1300 1400 1500 1600
ModeLine "1500x1400" 100 1500 1600 1700 1800 1400 1500 1600 1700
ModeLine "1500x1500" 100 1500 1600 1700 1800 1500 1600 1700 1800
ModeLine "1500x1600" 100 1500 1600 1700 1800 1600 1700 1800 1900
ModeLine "1500x1700" 100 1500 1600 1700 1800 1700 1800 1900 2000
ModeLine "1500x1800" 100 1500 1600 1700 1800 1800 1900 2000 2100
ModeLine "1500x1900" 100 1500 1600 1700 1800 1900 2000 2100 2200
ModeLine "1500x2000" 100 1500 1600 1700 1800 2000 2100 2200 2300
ModeLine "1600x100" 100 1600 1700 1800 1900 100 200 300 400
ModeLine "1600x200" 100 1600 1700 1800 1900 200 300 400 500
ModeLine "1600x300" 100 1600 1700 1800 1900 300 400 500 600
ModeLine "1600x400" 100 1600 1700 1800 1900 400 500 600 700
ModeLine "1600x500" 100 1600 1700 1800 1900 500 600 700 800
ModeLine "1600x600" 100 1600 1700 1800 1900 600 700 800 900
ModeLine "1600x700" 100 1600 1700 1800 1900 700 800 900 1000
ModeLine "1600x800" 100 1600 1700 1800 1900 800 900 1000 1100
ModeLine "1600x900" 100 1600 1700 1800 1900 900 1000 1100 1200
ModeLine "1600x1000" 100 1600 1700 1800 1900 1000 1100 1200 1300
ModeLine "1600x1100" 100 1600 1700 1800 1900 1100 1200 1300 1400
ModeLine "1600x1200" 100 1600 1700 1800 1900 1200 1300 1400 1500
ModeLine "1600x1300" 100 1600 1700 1800 1900 1300 1400 1500 1600
ModeLine "1600x1400" 100 1600 1700 1800 1900 1400 1500 1600 1700
ModeLine "1600x1500" 100 1600 1700 1800 1900 1500 1600 1700 1800
ModeLine "1600x1600" 100 1600 1700 1800 1900 1600 1700 1800 1900
ModeLine "1600x1700" 100 1600 1700 1800 1900 1700 1800 1900 2000
ModeLine "1600x1800" 100 1600 1700 1800 1900 1800 1900 2000 2100
ModeLine "1600x1900" 100 1600 1700 1800 1900 1900 2000 2100 2200
ModeLine "1600x2000" 100 1600 1700 1800 1900 2000 2100 2200 2300
ModeLine "1700x100" 100 1700 1800 1900 2000 100 200 300 400
ModeLine "1700x200" 100 1700 1800 1900 2000 200 300 400 500
ModeLine "1700x300" 100 1700 1800 1900 2000 300 400 500 600
ModeLine "1700x400" 100 1700 1800 1900 2000 400 500 600 700
ModeLine "1700x500" 100 1700 1800 1900 2000 500 600 700 800
ModeLine "1700x600" 100 1700 1800 1900 2000 600 700 800 900
ModeLine "1700x700" 100 1700 1800 1900 2000 700 800 900 1000
ModeLine "1700x800" 100 1700 1800 1900 2000 800 900 1000 1100
ModeLine "1700x900" 100 1700 1800 1900 2000 900 1000 1100 1200
ModeLine "1700x1000" 100 1700 1800 1900 2000 1000 1100 1200 1300
ModeLine "1700x1100" 100 1700 1800 1900 2000 1100 1200 1300 1400
ModeLine "1700x1200" 100 1700 1800 1900 2000 1200 1300 1400 1500
ModeLine "1700x1300" 100 1700 1800 1900 2000 1300 1400 1500 1600
ModeLine "1700x1400" 100 1700 1800 1900 2000 1400 1500 1600 1700
ModeLine "1700x1500" 100 1700 1800 1900 2000 1500 1600 1700 1800
ModeLine "1700x1600" 100 1700 1800 1900 2000 1600 1700 1800 1900
ModeLine "1700x1700" 100 1700 1800 1900 2000 1700 1800 1900 2000
ModeLine "1700x1800" 100 1700 1800 1900 2000 1800 1900 2000 2100
ModeLine "1700x1900" 100 1700 1800 1900 2000 1900 2000 2100 2200
ModeLine "1700x2000" 100 1700 1800 1900 2000 2000 2100 2200 2300
ModeLine "1800x100" 100 1800 1900 2000 2100 100 200 300 400
ModeLine "1800x200" 100 1800 1900 2000 2100 200 300 400 500
ModeLine "1800x300" 100 1800 1900 2000 2100 300 400 500 600
ModeLine "1800x400" 100 1800 1900 2000 2100 400 500 600 700
ModeLine "1800x500" 100 1800 1900 2000 2100 500 600 700 800
ModeLine "1800x600" 100 1800 1900 2000 2100 600 700 800 900
ModeLine "1800x700" 100 1800 1900 2000 2100 700 800 900 1000
ModeLine "1800x800" 100 1800 1900 2000 2100 800 900 1000 1100
ModeLine "1800x900" 100 1800 1900 2000 2100 900 1000 1100 1200
ModeLine "1800x1000" 100 1800 1900 2000 2100 1000 1100 1200 1300
ModeLine "1800x1100" 100 1800 1900 2000 2100 1100 1200 1300 1400
ModeLine "1800x1200" 100 1800 1900 2000 2100 1200 1300 1400 1500
ModeLine "1800x1300" 100 1800 1900 2000 2100 1300 1400 1500 1600
ModeLine "1800x1400" 100 1800 1900 2000 2100 1400 1500 1600 1700
ModeLine "1800x1500" 100 1800 1900 2000 2100 1500 1600 1700 1800
ModeLine "1800x1600" 100 1800 1900 2000 2100 1600 1700 1800 1900
ModeLine "1800x1700" 100 1800 1900 2000 2100 1700 1800 1900 2000
ModeLine "1800x1800" 100 1800 1900 2000 2100 1800 1900 2000 2100
ModeLine "1800x1900" 100 1800 1900 2000 2100 1900 2000 2100 2200
ModeLine "1800x2000" 100 1800 1900 2000 2100 2000 2100 2200 2300
ModeLine "1900x100" 100 1900 2000 2100 2200 100 200 300 400
ModeLine "1900x200" 100 1900 2000 2100 2200 200 300 400 500
ModeLine "1900x300" 100 1900 2000 2100 2200 300 400 500 600
ModeLine "1900x400" 100 1900 2000 2100 2200 400 500 600 700
ModeLine "1900x500" 100 1900 2000 2100 2200 500 600 700 800
ModeLine "1900x600" 100 1900 2000 2100 2200 600 700 800 900
ModeLine "1900x700" 100 1900 2000 2100 2200 700 800 900 1000
ModeLine "1900x800" 100 1900 2000 2100 2200 800 900 1000 1100
ModeLine "1900x900" 100 1900 2000 2100 2200 900 1000 1100 1200
ModeLine "1900x1000" 100 1900 2000 2100 2200 1000 1100 1200 1300
ModeLine "1900x1100" 100 1900 2000 2100 2200 1100 1200 1300 1400
ModeLine "1900x1200" 100 1900 2000 2100 2200 1200 1300 1400 1500
ModeLine "1900x1300" 100 1900 2000 2100 2200 1300 1400 1500 1600
ModeLine "1900x1400" 100 1900 2000 2100 2200 1400 1500 1600 1700
ModeLine "1900x1500" 100 1900 2000 2100 2200 1500 1600 1700 1800
ModeLine "1900x1600" 100 1900 2000 2100 2200 1600 1700 1800 1900
ModeLine "1900x1700" 100 1900 2000 2100 2200 1700 1800 1900 2000
ModeLine "1900x1800" 100 1900 2000 2100 2200 1800 1900 2000 2100
ModeLine "1900x1900" 100 1900 2000 2100 2200 1900 2000 2100 2200
ModeLine "1900x2000" 100 1900 2000 2100 2200 2000 2100 2200 2300
ModeLine "2000x100" 100 2000 2100 2200 2300 100 200 300 400
ModeLine "2000x200" 100 2000 2100 2200 2300 200 300 400 500
ModeLine "2000x300" 100 2000 2100 2200 2300 300 400 500 600
ModeLine "2000x400" 100 2000 2100 2200 2300 400 500 600 700
ModeLine "2000x500" 100 2000 2100 2200 2300 500 600 700 800
ModeLine "2000x600" 100 2000 2100 2200 2300 600 700 800 900
ModeLine "2000x700" 100 2000 2100 2200 2300 700 800 900 1000
ModeLine "2000x800" 100 2000 2100 2200 2300 800 900 1000 1100
ModeLine "2000x900" 100 2000 2100 2200 2300 900 1000 1100 1200
ModeLine "2000x1000" 100 2000 2100 2200 2300 1000 1100 1200 1300
ModeLine "2000x1100" 100 2000 2100 2200 2300 1100 1200 1300 1400
ModeLine "2000x1200" 100 2000 2100 2200 2300 1200 1300 1400 1500
ModeLine "2000x1300" 100 2000 2100 2200 2300 1300 1400 1500 1600
ModeLine "2000x1400" 100 2000 2100 2200 2300 1400 1500 1600 1700
ModeLine "2000x1500" 100 2000 2100 2200 2300 1500 1600 1700 1800
ModeLine "2000x1600" 100 2000 2100 2200 2300 1600 1700 1800 1900
ModeLine "2000x1700" 100 2000 2100 2200 2300 1700 1800 1900 2000
ModeLine "2000x1800" 100 2000 2100 2200 2300 1800 1900 2000 2100
ModeLine "2000x1900" 100 2000 2100 2200 2300 1900 2000 2100 2200
ModeLine "2000x2000" 100 2000 2100 2200 2300 2000 2100 2200 2300
EndSection
 
 
Section "Screen"
Identifier "Screen0"
Device "VMware SVGA"
Monitor "vmware"
# Don't specify DefaultColorDepth unless you know what you're
# doing. It will override the driver's preferences which can
# cause the X server not to run if the host doesn't support the
# depth.
Subsection "Display"
# VGA mode: better left untouched
Depth 4
Modes "640x480"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 8
Modes "1024x768"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 15
Modes "1024x768"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 16
Modes "1024x768"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 24
Modes "1024x768"
ViewPort 0 0
EndSubsection
EndSection
 





출처 : http://www.vmware.com/community/
2007/05/21 11:21 2007/05/21 11:21

Port to Linux ( 리눅스로 포팅을 하자! )

Posted by Jinho on 2006/12/17 21:10
Filed under Computer
Tags : , , , , , , , , , ,

Preface

Windows 프로그램을 리눅스로 포팅을 할때 가장 문제가 되는 것은 프로세스 쓰레드 관련 함수와 각종 IPC들이다. 소켓이나 기본적인 함수들은 모두 같이 사용이 되거나 용례가 비슷한데 반해서 이들은 완전히 독립적으로 동작이 되기 때문에 설계 자체를 바꿔야 하는 경우도 있다. 이를 좀더 쉽게 하기 위해서 각각에 대해서 어떻게 포팅을 해야 하는지를 정리해 보았다.

Process & Thread

Windows와 Linux가 process와 thread에 관련된 내부적 구조체 및 동작 방식은 완전히 다르다. 하지만, 이들을 조작하는 함수에는 거의 차이가 없다. 함수에 따라 거의 1:1로 변환이 가능하다.

Windows Linux
CreateProcess() fork()
exec()
TerminateProcess() kill()
WaitForSingleObject() waitpid()
pthread_join()
pthread_detach()
SetThreadpriority()
GetThreadPriority()
setpriority()
getpriority()
GetCurrentProcessID() getpid()
Exitprocess() exit()
CreateThread() pthread_create()
ThreadExit() pthread_exit()


Events

Evnet는 Windows에서 특정 사건이 발생했음을 알려주기 위해서 사용한다. Linux에서는 이를 위한 특별한 장치가 존재하지 않으므로 semaphore를 이용해서 이를 구현해 준다. 다만 초기화시에 초기값을 0으로 주기만 하면 된다.
Windows Linux
CreateEvent()
OpenEvent()
sem_init()
SetEvent() sem_post()
WaitForSingleObject() sem_wait()
sem_trywait()
CloseHandle() sem_destroy()

Semaphore

Semaphore는 Windows와 Linux의 용례가 비슷하다. Linux에서는 Windows의 event구현과 비슷하게 하면 되지만, 초기값을 얼마로 가지느냐만 다르게 설정을 해 주면 된다.
Windows Linux
CreateSemaphore() sem_init()
ReleaseSemaphore() sem_post()
WaitForSingleObject() sem_wait()
sem_trywait()
CloseHandle() sem_destroy()

Critical Section

Critical Section은 Windows에서 여러 쓰레드가 접근하지 못하는 임계 영역을 지정하기 위해서 사용된다. Critical Section은 Windows에서는 User객체로만 사용되며, 리눅스에서는 mutex로 구현을 해 주면 된다.
Windows Linux
InitializeCriticalSection() pthread_mutex_init()
DeleteCriticalSection() pthread_mutex_destroy()
EnterCriticalSection() pthread_mutex_lock()
LeaveCriticalSection() pthread_mutex_unlock()


Mutex

Mutex가 Windows의 Critical Section과의 차이점은 User영역 개체인지 Kernel 개체인지의 차이이다. Critical Section은 User모드 개체이기 때문에 하나의 프로세스 안에서 쓰레드 간의 임계영역 설정에 사용이 되지만, Mutex는 커널 모드 개채이므로 여러 프로세스간에 임계 영역 설정에 사용할 수 있다. Linux에서는 프로세스와 쓰레드간의 차이가 없으므로 mutex로만 구현되어 있다.
Windows Linux
CreateMutex() pthread_mutex_init()
CloseHandle() pthread_mutex_destroy()
WaitForSingleObject() pthread_mutex_lock()
ReleaseMutex() pthread_mutex_unlock()

Wrap up

Windows에서 Linux로 포팅할때 가장 신경써야 할 부분은 WaitForSingleObject와 WaitForMultipleObjects이다. 이 함수를 Linux로 가지고 갈때는 인자가 되는 핸들이 어느것이냐에 따라서 어떤 함수로 바꿔야 하는지가 결정이 되기 때문이다. 특히나 WaitForMultipleObjects에서 여러개의 핸들을 기다리면서 특정 이벤트가 일어나면 처리를 하는 경우에, 프로세스, 쓰레드, 뮤텍스, 소켓 등을 동시에 기다리면 이것들을 각기 다른 함수들로 분리를 해 줘야 하는데 이것은 정말 골치 아픈 일이다. 만약에 포팅을 염두에 두고 있다는 이러한 점에 각별히 신경을 쓰고 프로그래밍을 하도록 하자.
2006/12/17 21:10 2006/12/17 21:10

Linux Function Reference

Posted by Jinho on 2006/12/05 01:59
Filed under Computer/Linux
Tags : , , , , ,
리눅스 함수가 잘 정리되어 있는 레퍼런스 페이지.

http://jamesthornton.com/linux/man/


http://www.die.net/doc/linux/
2006/12/05 01:59 2006/12/05 01:59

라이브러리 찾기

Posted by Jinho on 2006/11/22 19:32
Filed under Computer/Linux
Tags : , ,
특정한 라이브러리를 써서 컴파일을 하다가 보면 링크 에러가 날때가 있다.
이럴때는 라이브러리를 링크해주어야 한다.

라이브러리를 찾을때는 아래와 같이한다.

# nm -A /usr/lib/*.a 2>/dev/null |grep [function_name]


nm 명령어로 모든 함수명을 출력한다.
2>/dev/null은 오류 메시지를 표시 하지 않는다는 뜻이다.
1은 표준 출력 2는 오류 출력을 의미하며 이걸 null device로 리다이렉트 시키면 출력이 되지 않는다.

여기서 원하는 라이브러리 명을 찾았다면 이것을 링크시에 추가시켜 주면 된다.
만약에 찾은 라이브러리 명이 pthread라면 앞에 -l을 붙여서 컴파일을 해 주면 된다.

# gcc -o hello hello.c -lpthread


2006/11/22 19:32 2006/11/22 19:32

QT/X11 설치

Posted by Jinho on 2006/11/15 19:09
Filed under Computer/Linux
Tags : , , ,
QT/X11의 간단한 설치법이다. 웹을 찾아서 정리한 내용이므로 틀리수도 있다.
버젼은 3.x를 기준으로 하였다.
2.x는 qmake가 없으므로 progen과 tmake를 가지고 컴파일을 해 주어야한다.
기본 폴더는 /qt에 qt-x11-free-3.3.7.tar.bz2 파일을 가지고 있다고 생각하고 시작을 해 준다.

1.파일의 복사

[root@localhost qt]# tar xjf qt-x11-free-3.3.7.tar.bz2


- 생성된 디렉토리의 이름을 바꾸어준다 (정해진것은 아니다.)

[root@localhost qt]# mv qt-x11-free-3.3.7 qte


2.설정을 해준다.

[root@localhost qt]# vi qte.env


QTDIR=/qt/qte
PATH=$QTDIR/bin:$PATH
MANPATH=$QTDIR/doc/man:$MANPATH
LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export QTDIR PATH MANPATH LD_LIBRARY_PATH
:wq (저장하고 빠져나온다)

여기서 qte.env의 내용을 부팅시 적용하게 할수도 있지만,
그럴경우 readhat 9.0에서 로그인시에 쉘이 죽는 문제가 생길수도 있다.

3.설정을 적용한다.

[root@localhost qt]# cd qte
[root@localhost qte]# source qte.env


4.configuration

[root@localhost qte]# ./configure


라이센스를 물어보면 'yes'라고 입력한다.

5.컴파일

[root@localhost qte]# make


컴파일을 하게 되며 시간이 걸린다.

6.설치

[root@localhost qte]# make install


root가 아니라면 su -c "make install" 를 해준다.

7.설치가 완료 되었다.

----------------------------------------------------------------------

QT designer에서 만든 UI를 컴파일하기.


1.프로젝트 파일 생성

# qmake -project


UI파일이 있는 폴더로 가서 qmake -project 를 실행해준다.
이 과정은 그 폴더에 있는 모든 파일을 이용해서 project파일을 만들어준다.
별도의 옵션을 주면 프로젝트에 추가할 파일만 설정할수 있지만 해보지 않아서 모르겠다.

2.Makefile생성

# qmake -makefile


이것을 해 주면 project파일에 있는 파일을을 가지고 Makefile을 만들어준다.

3.컴파일

# make



이것으로 컴파일이 완료된다.


2006/11/15 19:09 2006/11/15 19:09