From owner-freebsd-questions Wed Feb 24 14:33:52 1999 Delivered-To: freebsd-questions@freebsd.org Received: from netshell.vicosa.com.br (netshell.vicosa.com.br [200.236.148.170]) by hub.freebsd.org (Postfix) with SMTP id 4367B11DEA for ; Wed, 24 Feb 1999 14:27:19 -0800 (PST) (envelope-from grios@netshell.vicosa.com.br) Received: (qmail 29844 invoked by uid 1070); 24 Feb 1999 20:41:33 -0000 Date: Wed, 24 Feb 1999 17:41:33 -0300 (EST) From: Gustavo Vieira Goncalves Coelho Rios To: Oscar Bonilla Cc: dan@jgl.reno.nv.us, grios@netshell.vicosa.com.br, freebsd-questions@FreeBSD.ORG, grog@lemis.com Subject: Re: assembly In-Reply-To: <199902241758.LAA41672@fisicc-ufm.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Thank you for your nice answer! It was very, very good! That's the way others should follow too! If ones can contribute with answer, mail them, or else, don't send nothing! --- I use UNIX because reboots are for hardware upgrades. You use windowze because the guy on TV told you to ... --- Gustavo Rios - UIN 27456973 - UNIX Sys Admin ----- On Wed, 24 Feb 1999, Oscar Bonilla wrote: > > I don't believe (i am sorry if i am wrong, but i am a beginner)! > > If i use assembly i do not need to read a file via read API, i can > > access the HD directly, without to check for access permissions, right ? > > If so, i can hack a UNIX system (no matter which) using assembly! > > > > Am i wrong ? > > > YES! > > i know you've been replied more than once on this, but here goes my reply too. > > advice: get a book about operating systems and another book on computer > architecture. > > look up the following: > > dual mode operation (kernel mode, user mode) > protection > address spaces > memory translation > > assembler is a programming language, and as such is no different than C. > i mean, the c compiler translates your C code to assembler and the assembles > it using an assembler (as). Anything you can do in assembler you can do in C. > the protection is not in the C compiler, is in the way the cpu runs your programs. in unix, the kernel runs in a higher level of protection than user programs. > this means that some instruction are priviledged and can only be executed by > the kernel. > > if you write a program in assembler that tries to write directly to the > hard drive without using the system call interface (API as you called it) > the cpu will say "hey! this is a priviledged operation this user program is > trying to execute, better check what the kernel has to say about it" and > inform the kernel via a trap. the kernel will happily kill your process. > end of story. > > as i said before, get a book about OS's and CA. > > regards, > > -oscar > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message