From owner-freebsd-drivers@FreeBSD.ORG Mon Nov 17 02:12:19 2014 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85BADBD6 for ; Mon, 17 Nov 2014 02:12:19 +0000 (UTC) Received: from land.berklix.org (land.berklix.org [144.76.10.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 127E9AAF for ; Mon, 17 Nov 2014 02:12:18 +0000 (UTC) Received: from mart.js.berklix.net (p57BCF9E3.dip0.t-ipconnect.de [87.188.249.227]) (authenticated bits=128) by land.berklix.org (8.14.5/8.14.5) with ESMTP id sAH28FpH004724; Mon, 17 Nov 2014 02:08:17 GMT (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by mart.js.berklix.net (8.14.3/8.14.3) with ESMTP id sAH2C1LV063609; Mon, 17 Nov 2014 03:12:01 +0100 (CET) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.7/8.14.7) with ESMTP id sAH2Bhtg057567; Mon, 17 Nov 2014 03:11:55 +0100 (CET) (envelope-from jhs@berklix.com) Message-Id: <201411170211.sAH2Bhtg057567@fire.js.berklix.net> To: =?UTF-8?Q?fran=C3=A7ai_s?= Subject: Re: Exist tutorial that teaches programming in machine code to FreeBSD? From: "Julian H. Stacey" Organization: http://berklix.com BSD Unix Linux Consultants, Munich Germany User-agent: EXMH on FreeBSD http://berklix.com/free/ X-URL: http://www.berklix.com In-reply-to: Your message "Fri, 14 Nov 2014 21:39:31 -0200." Date: Mon, 17 Nov 2014 03:11:43 +0100 Cc: freebsd-drivers@freebsd.org X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 02:12:19 -0000 =?UTF-8?Q?fran=C3=A7ai_s?= wrote: > A FreeBSD developer told me via private message that the most FreeBSD > developers don’t develop in machine code. > > The following link leads to tutorial that teaches programming Assembly in > to FreeBSD: > http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/x86.html There's an x86 in your URL. Did You know that FreeBSD supports other CPUs too ? Did you decide to target the x86 CPU ? Or just come across that URL ? > Also exist tutorial that teaches programming in machine code to FreeBSD? ................................................. ^^^^^^^ I hope not! There's a difference between Assembler & Machine programming: http://en.wikipedia.org/wiki/Machine_code "While it is possible to write programs directly in numerical machine code, it is tedious and error prone to manage individual bits and calculate numerical addresses and constants manually. It is therefore rarely done today, except for situations that require extreme optimization or debugging. Almost all practical programs today are written in higher-level languages or assembly language," http://en.wikipedia.org/wiki/Assembly_language My last need to machine code program was probably for an NSC 16032 in ~1982. I had to as I had no C compiler, assembler, or computer. I hand coded Hex on paper, typed & burnt it to an Eprom on a borrowed MDS, & my logic analyser showed it ran on my co- designed & self wrapped board - Magic! Then on CPM I wrote http://berklix.com/~jhs/src/bsd/jhs/bin/local/monitor/ & we decided to avoid more machine code, & buy a compiler & assembler ! Now there's free compilers & assemblers, so more than ever: Doing much machine code programming is erroneous, (though assembly programming remains occasionaly appropriate &/or essential). Your x86 URL leads to 2 assemblers, no need to program in Machine Code. I vaguely thought there was an assembler in docs/ but a find in /usr/share failed to find an appropriate 'as'. man as Maybe some ports like binutils & gas might include refs to tutorials http://www.freebsd.org/cgi/ports.cgi?query=binutils&stype=all http://www.freebsd.org/cgi/ports.cgi?query=gas&stype=all&sektion=all http://svnweb.freebsd.org/ports/head/lang/intel2gas/ http://www.freebsd.org/cgi/ports.cgi?query=nasm&stype=all&sektion=all This list might discuss ports/ components that deliver tutorials: freebsd-toolchain@freebsd.org http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain Cheers, Julian -- Julian Stacey, BSD Linux Unix C Sys Eng Consultant Munich http://berklix.com Indent previous with "> ". Interleave reply paragraphs like a play script. Send plain text, not quoted-printable, HTML, base64, or multipart/alternative.