Posts

Showing posts with the label operating-system

What is full name of fcntl Unix/Linux system call

What is full name of fcntl Unix/Linux system call Man page of fcntl tell its used for manipulating file descriptors. But this name is not easy to remember. Knowing its full name will help in remember this system call name and its use. I tried to find on internet but could not get anything except man pages. fcntl Please someone tell what is full name or origin of name of fcntl. 1 Answer 1 From POSIX, it is F ile C o nt ro l : NAME      fcntl - f ile c o nt ro l fcntl There is a related system call, ioctl , i.e. I nput- O utput C on t ro l . The difference between the 2 is that fcntl modifies the file descriptor / file description, whereas ioctl controls behaviour of the input/output device behind the file description. ioctl fcntl ioctl Now, you just have to remember if it's fcntl , fctl or fctrl :p – ikegami Nov 27 '17 at 1...

Using ld to link a file makes it too big for a boot loader, works in nasm though :(

Using ld to link a file makes it too big for a boot loader, works in nasm though :( I'm trying to make a simple bootloader, but running into issues with ld (I think). When I compile my assembly file (below) with nasm -f bin , it works and I get a nice 512 byte file. For that one I include org 0x7c00 at the top and everything works as expected. nasm -f bin However, now I'm trying to do something a bit more complicated and link in a C kernel (unclear if I'm on the right path there, but I'm sure I'll learn that soon). Anyway, when I compile it with nasm -f elf -o loader_elf bootloader.asm and link it with i386-elf-ld loader_elf -o loader_exe -Ttext 0x7C00 , I get a file that is 4196 bytes (with a 1152 byte elf file). nasm -f elf -o loader_elf bootloader.asm i386-elf-ld loader_elf -o loader_exe -Ttext 0x7C00 What do I need to do for either the elf file or ld to get an executable with a proper file size? Thanks for your help! Here's the file in question: bits 16 ; 1...