12월, 2016의 게시물 표시

OS/2 codes: How to control CD-ROM drives

OS/2 provides ioctl commands to control CD-ROM drives and discs. And some commands have been added with new OS2CDROM.DMD. In this article, let's research the ways to control CD-ROM drives and to utilize new commands. 1. Opening or Closing a Tray The most strange thing of OS/2 ioctl commands are CDROMDISK_CLOSETRAY . It's not possible to issue the command. Because a handle for a disc is required to issue, but there is no way to open a handle for the opened drives. This is applied to CDROMDISK_EJECTDISK . It's not possible to issue the command if a disc is not in a drive. To open and/or to close a tray, another way should be used. OS/2 provides general ioctl commands to eject and to load a media for a removable media . Ejecting is used to open a tray. Loading is used to close a tray. These commands can be issued without a handle. Therefore, it's possible to open and to close a tray even if a disc is not in the drive. Codes are like this: Colored By Color Scri...

OS/2 codes: How to manipulate FAT32 paritions

On OS/2, in general, it's possible to access to any partitions in DASD mode. This is true for FAT32 partitions. Unfortunately, however, accessing in DASD mode may not work on FAT32 partitions, especially writing to them. Instead, FAT32.IFS provides special ioctl commands. Let's see the way accessing to FAT32 partitions. 1. Accessing FAT32 partitions in DASD mode Accessing in DASD mode is the general ways on OS/2. Unfortunately, however, FAT32.IFS does not allow to access the areas beyond 2GB by default. This is true for HPFS.IFS. To overcome this problem, FAT32.IFS provides a special mode, SECTOR IO mode, like HPFS.IFS. If the sector io mode is enabled, accessing in DASD mode is performed in sectors not in bytes. To enable sector io mode, you should call DosFSCtl() , and pass 0xDEADFACE as a parameter list like this: Colored By Color Scripter ™ 1 2 3 4 5 6 7 ULONG cbData     = 0; ULONG ulDeadFace = 0xDEADFACE; ULON...

OS/2 codes: How to get information about CPUs

OS/2 provides various APIs to get information of CPU, from number of CPUs to CPU time snapshot. 1. Number of CPUs 1.1 DosQuerySysInfo( QSV_NUMPROCESSORS ) DosQuerySysInfo() returns the requested system information. If passing QSV_NUMPROCESSORS , number of CPUs are returned to the buffer. Look: DosQuerySysInfo( QSV_NUMPROCESSORS, QSV_NUMPROCESSORS,                  &ulCpus, sizeof( ulCpus )) 1.2 DosGetProcessorStatus() DosGetProcessorStatus() returns the status of the given CPU ID starting from 1. If CPU ID is valid, that is, ID-th CPU exists, it returns PROC_ONLINE or PROC_OFFLINE according to the status of that CPU. PROC_ONLINE means that the given CPU is available for running work. PROC_OFFLINE means that the given CPU is not available. Whereas the given CPU does not exist, it returns an error, ERROR_INVALID_PARAMETER . After all, number of CPUs can be caculated if counting from 1 unt...

OS/2 codes: How to check if IFS was loaded

IFS stands for Installable File System. With IFS, OS/2 can support various file systems even if they are not supported by default. What should we do to check if a specific IFS was loaded ? First of all, we can iterate all drives from A to Z, and check the attached IFS to them. However, this method cannot check IFS which is loaded but not attached yet. In addition, same IFS may be attached to the different drives. This causes extra cost when programming. To solve the above unconveniences is to check IFS directly. How ? DosFSCtl() provides such functions. DosFSCtl() provides the communication between an application and a specific IFS. If the given IFS was not loaded, it returns ERROR_INVALID_FSD_NAME , otherwise any other error codes. Using this, it's possible to check if a specific IFS was loaded. However, note that the IFS name passed to DosFSCtl() is neither the filename of the IFS nor the file-system name in the boot sector. It's the exported name by IFS. For examp...

OS/2 codes: How to emulate COPY-ON-WRITE #4 Epilogue

So far, we've researched the basic strucutre of the implementation of the copy-on-write feature. As well as, we've looked into the ways to enable copy-on-write in all threads including a main thread. Nevertheless, this approach has some limitations. Copy-on-write will not work if it is used in a thread started by custom codes using DosCreateThread() not _beginthread() it is used in an alien thread created in DLLs not linked with copy-on-write module source memory blocks are allocated malloc() not DosAllocMem() In the above first two cases, installing/uninstalling an exception handler in the context using copy-on-write manually is needed. In case of malloc(), it may be succeeded, but it's not recommended. Failure possibility is higher. Finally, copy-on-write not supported by Kernel is not optimal and may not be useful due to its efficiency. However, the fact itself that implementation of copy-on-write is possible is meaningful even if it is not actually usefu...

OS/2 codes: How to emulate COPY-ON-WRITE #3 Install exception handler

To activate the exception handler, it's needed to install it. By the way, the handler works only on the thread on which it is installed. After, we should install the handler on every threads. Let's see the way to install a handler first: EXCEPTIONREGISTRATIONRECORD regRec = { 0 }; /* Register an exception handler for SIGSEGV */ regRec.ExceptionHandler = ( ERR )sigsegv; DosSetExceptionHandler( &regRec ); EXCEPTIONREGISTRATIONRECORD is a type to register handler. Generally, it should be initialized to 0 except ExceptionHandler field. ExceptionHandler should be set to the handler to be registered. Finally, register the handler with DosSetExceptionHandler() . Here, note that EXCEPTIONREGISTRATIONRECORD variables should be placed in the stack . Uninstalling the installed handler is simple: /* Deregister an exception handler */ DosUnsetExceptionHandler( &regRec ); regRec is the variable which was used when installing the handler. DosUnsetExceptionHandler() ...

OS/2 codes: How to emulate COPY-ON-WRITE #2 Exception handler

In the previous article, we looked into a basic structure of a main function. In that, the last question was how to catch write access to the registered memory blocks. Here is the answer. It's the exception. We removed WRITE permission of the memory blocks. Because of this, writing to those blocks causes an exception, so called SIGSEGV. To catch such exceptions, we should implement exception handlers. Exception handler is like this: ULONG _System sigsegv( PEXCEPTIONREPORTRECORD p1,                        PEXCEPTIONREGISTRATIONRECORD p2,                        PCONTEXTRECORD p3,                        PVOID pv ); Out of the above parameters, p1 is the most im...

OS/2 codes: How to emulate COPY-ON-WRITE #1 main function

A basic principle of copy-on-write is the following. Remove WRITE permission of source memory blocks Create an alias memory without WRITE permission for source memory blocks Register information for these Let's see the ways to implement the above sentences. 1. Remove WRITE permission / Alter access protections of memory blocks To do this, all you have to do is calling DosSetMem() like this: DosSetMem ( p, cb, flSrc & ~PAG_WRITE )) Where p is the pointer to the source memory block, cb is the size of the blocks, flSrc is the access protection flags of those. Then, how can we get the protection flags of the source blocks ? Use DosQueryMem(): DosQueryMem ( p, &cbSrc, &flSrc ); Where p is the pointer to the memory block, cbSrc is the size to be queried. flSrc is the place where to store access flags. 2. Create an alias memory An alias memory is an memory sharing same contents with the original memory. For details, see < DosAliasMem(), ma...

OS/2 codes: How to emulate COPY-ON-WRITE #0 Prologue

Copy-On-Write is a feature to improve copy performance. That is, memory blocks share the same contents until copy operation to those blocks really occur. By postponing copy-operations until it is needed really, it's possible to remove initial overheads of copy operation. This was needed to implement mmap(). Espeically, MAP_PRIVATE. On Linux( http://man7.org/linux/man-pages/man2/mmap.2.html ), copy-on-write feature is used. I thought it's not possible without kernel supports. However, Dave Yeo suggested DosAliasMem(). I thought it may be possible. I did implement such a feature. A series of the following articles are records of implementing copy-on-write on OS/2.

토렌트: < 하이큐 > 3기 < 카라스노 고교 vs 시라토리자와 학원 고교 > 완결(1화~10화) 마그넷

 소년 스포츠물의 명작 <하이큐> 3기 <카라스노 고교 vs 시라토리자와 학원 고교> 입니다. <하이큐> 3기 <카라스노 고교 vs 시라토리자와 학원 고교> 마그넷 주소: magnet:?xt=urn:btih:E61A7B439C939DA8857FE35690FF7E5FFF54A022 마그넷 주소로 토렌트 다운 받기 uTorrent 다운 받기 마그넷 주소 클릭하기 uTorrent 가 자동으로 실행되면 그대로 토렌트 다운 받기 uTorrent 가 자동으로 실행되지 않으면 마그넷 링크 주소 복사 uTorrent 실행 [파일] - [주소에서 토렌트 추가] 클립보드에 저장한 주소가 입력 창에 입력 되어 있음 복사한 주소가 아니면 마그넷 링크 주소 복사 토렌트 다운 받기

uTorrent 광고 없애기

토렌트를 애용하는 사람이라면 토렌트의 대명사 uTorrent 를 알고 있을 것이다. uTorrent 는 무료로 사용할 수 있지만, 대신에 윗쪽과 왼쪽에 광고를 노출한다. 크게 문제는 없지만, 간혹 19금스러운 광고들이 나올 때면 깜짝 놀라기도 한다. 그리고 광고 때문인지는 모르지만, uTorrent 를 처음 실행할 때 느려지는 현상도 있다. 이런 저런 이유로 광고를 없애고 싶은 사람들은 이렇게 하자. <uTorrent> 실행 [옵션] - [설정] 선택 왼쪽 패널에서 [고급 설정] 선택 [필터] 입력 필드에 "offers" 입력 나열된 키 중에서 [offers.left_offer_enabled] 와 [offers.sponsored_torrent_offer_enabled] 에서 "false" 로 바꿈( 더블 클릭 하면바뀜) [확인] 버튼 누른 후 재시작 이렇게 하면 윗쪽과 왼쪽에 광고가 더이상 나타나지 않는다. * 출처: http://clien.net/cs2/bbs/board.php?bo_table=lecture&wr_id=341928

요즘 쓸만한 공개 뉴스 서버

유선 인터넷은 SK 브로드밴드(SKB) 를 이용하고 있다. 옛날 옛적 하나로의 후신이다. 하나로 시절만해도 뉴스서버를 이용하는 데 문제가 없었다. SKB 로 바뀐 이후에도 뉴스 서버는 잘 작동하였는데, 2015년 말이었던 듯하다. 갑자기 뉴스 서버에서 기사들을 읽어오지 못하는 현상이 발생했다. 다른 뉴스 그룹들의 기사는 잘 보였는데, 유독 OS/2 관련 뉴스그룹에서만 기사를 가져오지 못했다. 잠시 오류가 있는 것뿐이겠거니 했는데, 지금까지도 되지 않고 있다. 그 사이 구글 뉴스 그룹 서비스를 간간이 이용하였는데, 전용 프로그램에 비해 많이 불편하였다. 그래서 공개 뉴스 서버가 없는지 찾아보았다. 사실 아주 오래전 파워콤을 썼던 적이 있었다. 파워콤은 뉴스 서버를 제공하지 않았다. 어쩔 수 없이 공개 뉴스 서버를 써야 했는데, 그 당시 널리 알려졌던 뉴스 서버는 kreonet 의 뉴스 서버였다. 하지만, 관리자가 바뀐 것인지 꽤 오래전부터 뉴스 서버를 제공하지 않는다. 인터넷을 검색해봐도 아주 오래전 글들 뿐이라 요즘에 쓸 수 있는 공개 뉴스 서버들은 없었다. 그러던 중 우연찮게 아주 쓸만한 뉴스 서버 하나를 찾았다. 지금 잘 쓰고 있다. Aioe.org 공개 뉴스 서버이다. 홈페이지는 http://www.aioe.org 이다. 몇 가지 제약이 있지만, 사용에 지장을 줄 정도는 아니다. IP 주소당 하루에 최대 25 개의 메세지를 작성할 수 있다 하루에 세 개 이상의 메세지가 거절되면, 24 시간동안 글을 작성할 수 없다 각 글은 세 개 미만의 그룹(크로스포스트)에만 보낼 수 있다. 각 글은 최대 세 개의 후속 그룹을 포함할 수 있다 기사는 최대 32KB, 헤더는 최대 2KB 까지 허용된다 nntp.aioe.org 에는 최대 4 개의 동시 접속이 허용된다 news.aioe.org 에는 최대 2 개의 동시 접속이 허용된다 IP 주소당 하루에 400 번의 접속을 허락한다 스팸, 포르노, 소아성애 및 어떤 형태의 욕설도 용납되지 ...

OS/2 tricks: How to set up DBCS environment on SBCS OS/2 #4 Epilogue

So far, we've researched the ways to enable DBCS environment on SBCS OS/2. First was how to configure OS/2. Second was how to display DBCS characters. Third was how to input DBCS characters. Neverthless, however, it is not possible to set DBCS environment up on SBCS OS/2, perfectly. Of course, the best and perfect way is to provide DBCS OS/2. However, if it's not possible, then resource corruption of eWP on DBCS code pages should be fixed , at least. eCo Software has been working on the Language Interface Pack project( http://en.ecomstation.ru/projects/lip/ ) which enables to switch messages and texts of eComStation to the localized messages and texts. Support for this project will be also helpful to DBCS users as well as SBCS users. I wish DBCS users use the latest OS/2 without any restrictions.

OS/2 tricks: How to set up DBCS environment on SBCS OS/2 #3 Input DBCS characters

The last step is to enable input DBCS characters. DBCS OS/2 provides a special program, IME(Input Method Editor), to input DBCS characters. Of course, SBCS OS/2 does not. But, there are several ways to input DBCS characters. 1. Web IME Web IME is the web service provides IME. In this case, it's not possible to input DBCS characters to a window directly. Instead, you should use COPY-AND-PASTE. 1.1 InputKing ( http://www.inputking.com/ ) This web IME supports various languages such as European, Russian and Indian as well as Chinese, Japan, Korean and Vietnamese. 2. Native IME Native IME is an OS/2 program to provide IME. But not all IMEs support to input DBCS characters directly. 2.1.Chinese 2.1.1 Bridge2-Hi ( https://www.arcanoae.com/shop/bridge2-hi/ ) This program supports to input Chinese characters, Hanzi. This is not free. 2.2. Japanese 2.2.1 IMERJ ( http://www.altsan.org/programming/os2/index.html#imerj ) This program supports to input Japanese char...

OS/2 announce: pkg-config v0.29.1 for OS/2 released

pkg-config v0.29.1 for OS/2 have been released. OS/2 용 pkg-config v0.29.1 를 발표하였습니다. They can be downloaded from : 다음 링크를 클릭하면 받을 수 있습니다 : http://hobbes.nmsu.edu/h-search.php?key=pkg-config-0.29.1.zip&pushbutton=Search Enjoy Warping !!! Korean OS/2 User Community : http://www.ecomstation.co.kr